Skip to content

Commit

Permalink
Revert "fix(): check if values are undef before passing down to input."
Browse files Browse the repository at this point in the history
This reverts commit 8b7038f.
  • Loading branch information
jthoms1 committed Oct 19, 2017
1 parent 8b7038f commit df80971
Showing 1 changed file with 25 additions and 35 deletions.
60 changes: 25 additions & 35 deletions packages/core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,6 @@ export class Input implements InputComponent {
return (this.value !== null && this.value !== undefined && this.value !== '');
}

reduceUndefProps(props: { [ key: string]: any}) {
return Object.keys(props).reduce((final, propName) => {
if (props[propName] != null) {
final[propName] = props[propName];
}
return final;
}, {} as { [key: string]: any});
}

protected render() {
const themedClasses = createThemedClasses(this.mode, this.color, 'text-input');
Expand All @@ -334,37 +326,35 @@ export class Input implements InputComponent {
return [
<input
aria-disabled={this.disabled ? 'true' : false}
accept={this.accept}
autoCapitalize={this.autocapitalize}
autoComplete={this.autocomplete}
autoCorrect={this.autocorrect}
autoFocus={this.autofocus}
checked={this.checked}
disabled={this.disabled}
inputMode={this.inputmode}
min={this.min}
max={this.max}
minLength={this.minlength}
maxLength={this.maxlength}
multiple={this.multiple}
name={this.name}
pattern={this.pattern}
placeholder={this.placeholder}
results={this.results}
readOnly={this.readonly}
required={this.required}
spellCheck={this.spellcheck}
step={this.step}
size={this.size}
type={this.type}
value={this.value}
class={themedClasses}
onBlur={this.inputBlurred.bind(this)}
onInput={this.inputChanged.bind(this)}
onFocus={this.inputFocused.bind(this)}
onKeyDown={this.inputKeydown.bind(this)}
{...this.reduceUndefProps({
accept: this.accept,
autoCapitalize: this.autocapitalize,
autoComplete: this.autocomplete,
autoCorrect: this.autocorrect,
autoFocus: this.autofocus,
checked: this.checked,
disabled: this.disabled,
inputMode: this.inputmode,
min: this.min,
max: this.max,
minLength: this.minlength,
maxLength: this.maxlength,
multiple: this.multiple,
name: this.name,
pattern: this.pattern,
placeholder: this.placeholder,
results: this.results,
readOnly: this.readonly,
required: this.required,
spellCheck: this.spellcheck,
step: this.step,
size: this.size,
type: this.type,
value: this.value,
class: themedClasses
})}
/>,
<button
hidden={this.clearInput !== true}
Expand Down

0 comments on commit df80971

Please sign in to comment.