fix(label): placeholder + floating label (#16111)

* fix(label): placeholder + floating label

* fix placeholder type

* update docs

* uodate docs
This commit is contained in:
Manu MA
2018-11-02 22:15:28 +01:00
committed by GitHub
parent 4a2a458cc9
commit a8be5291bb
12 changed files with 205 additions and 156 deletions

View File

@ -133,7 +133,7 @@ export class Input implements ComponentInterface {
/**
* Instructional text that shows before the input has a value.
*/
@Prop() placeholder?: string;
@Prop() placeholder?: string | null;
/**
* If `true`, the user cannot modify the value.
@ -263,6 +263,7 @@ export class Input implements ComponentInterface {
this.ionStyle.emit({
'interactive': true,
'input': true,
'has-placeholder': this.placeholder != null,
'has-value': this.hasValue(),
'has-focus': this.hasFocus,
'interactive-disabled': this.disabled,
@ -355,7 +356,7 @@ export class Input implements ComponentInterface {
multiple={this.multiple}
name={this.name}
pattern={this.pattern}
placeholder={this.placeholder}
placeholder={this.placeholder || ''}
results={this.results}
readOnly={this.readonly}
required={this.required}