fix(input, select, textarea): change type of placeholder prop to string only (#23500)

resolves #22976

BREAKING CHANGE: Updated the `placeholder` property on `ion-input`, `ion-textarea`, and `ion-select` to have a type of `string | undefined`.
This commit is contained in:
William Martin
2021-06-24 10:23:19 -04:00
committed by GitHub
parent ceabba154c
commit f3ae4319bb
9 changed files with 34 additions and 19 deletions

View File

@ -54,7 +54,7 @@ export class Select implements ComponentInterface {
/**
* The text to display when the select is empty.
*/
@Prop() placeholder?: string | null;
@Prop() placeholder?: string;
/**
* The name of the control, which is submitted with the form data.
@ -412,7 +412,7 @@ export class Select implements ComponentInterface {
this.ionStyle.emit({
'interactive': true,
'select': true,
'has-placeholder': this.placeholder != null,
'has-placeholder': this.placeholder !== undefined,
'has-value': this.hasValue(),
'interactive-disabled': this.disabled,
'select-disabled': this.disabled
@ -442,7 +442,7 @@ export class Select implements ComponentInterface {
let addPlaceholderClass = false;
let selectText = displayValue;
if (selectText === '' && placeholder != null) {
if (selectText === '' && placeholder !== undefined) {
selectText = placeholder;
addPlaceholderClass = true;
}