Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ ion-input,prop,mode,"ios" | "md",undefined,false,false
ion-input,prop,multiple,boolean | undefined,undefined,false,false
ion-input,prop,name,string,this.inputId,false,false
ion-input,prop,pattern,string | undefined,undefined,false,false
ion-input,prop,placeholder,null | string | undefined,undefined,false,false
ion-input,prop,placeholder,string | undefined,undefined,false,false
ion-input,prop,readonly,boolean,false,false,false
ion-input,prop,required,boolean,false,false,false
ion-input,prop,size,number | undefined,undefined,false,false
Expand Down Expand Up @@ -1144,7 +1144,7 @@ ion-select,prop,mode,"ios" | "md",undefined,false,false
ion-select,prop,multiple,boolean,false,false,false
ion-select,prop,name,string,this.inputId,false,false
ion-select,prop,okText,string,'OK',false,false
ion-select,prop,placeholder,null | string | undefined,undefined,false,false
ion-select,prop,placeholder,string | undefined,undefined,false,false
ion-select,prop,selectedText,null | string | undefined,undefined,false,false
ion-select,prop,value,any,undefined,false,false
ion-select,method,open,open(event?: UIEvent | undefined) => Promise<any>
Expand Down Expand Up @@ -1298,7 +1298,7 @@ ion-textarea,prop,maxlength,number | undefined,undefined,false,false
ion-textarea,prop,minlength,number | undefined,undefined,false,false
ion-textarea,prop,mode,"ios" | "md",undefined,false,false
ion-textarea,prop,name,string,this.inputId,false,false
ion-textarea,prop,placeholder,null | string | undefined,undefined,false,false
ion-textarea,prop,placeholder,string | undefined,undefined,false,false
ion-textarea,prop,readonly,boolean,false,false,false
ion-textarea,prop,required,boolean,false,false,false
ion-textarea,prop,rows,number | undefined,undefined,false,false
Expand Down
12 changes: 6 additions & 6 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ export namespace Components {
/**
* Instructional text that shows before the input has a value.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* If `true`, the user cannot modify the value.
*/
Expand Down Expand Up @@ -2323,7 +2323,7 @@ export namespace Components {
/**
* The text to display when the select is empty.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* The text to display instead of the selected option's value.
*/
Expand Down Expand Up @@ -2663,7 +2663,7 @@ export namespace Components {
/**
* Instructional text that shows before the input has a value.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* If `true`, the user cannot modify the value.
*/
Expand Down Expand Up @@ -4621,7 +4621,7 @@ declare namespace LocalJSX {
/**
* Instructional text that shows before the input has a value.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* If `true`, the user cannot modify the value.
*/
Expand Down Expand Up @@ -5899,7 +5899,7 @@ declare namespace LocalJSX {
/**
* The text to display when the select is empty.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* The text to display instead of the selected option's value.
*/
Expand Down Expand Up @@ -6245,7 +6245,7 @@ declare namespace LocalJSX {
/**
* Instructional text that shows before the input has a value.
*/
"placeholder"?: string | null;
"placeholder"?: string;
/**
* If `true`, the user cannot modify the value.
*/
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class Input implements ComponentInterface {
/**
* Instructional text that shows before the input has a value.
*/
@Prop() placeholder?: string | null;
@Prop() placeholder?: string;

/**
* If `true`, the user cannot modify the value.
Expand Down Expand Up @@ -302,7 +302,7 @@ export class Input implements ComponentInterface {
this.ionStyle.emit({
'interactive': true,
'input': true,
'has-placeholder': this.placeholder != null,
'has-placeholder': this.placeholder !== undefined,
'has-value': this.hasValue(),
'has-focus': this.hasFocus,
'interactive-disabled': this.disabled,
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export default defineComponent({
| `multiple` | `multiple` | If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `"email"` or `"file"`, otherwise it is ignored. | `boolean \| undefined` | `undefined` |
| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | `this.inputId` |
| `pattern` | `pattern` | A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, `"date"`, or `"password"`, otherwise it is ignored. When the type attribute is `"date"`, `pattern` will only be used in browsers that do not support the `"date"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information. | `string \| undefined` | `undefined` |
| `placeholder` | `placeholder` | Instructional text that shows before the input has a value. | `null \| string \| undefined` | `undefined` |
| `placeholder` | `placeholder` | Instructional text that shows before the input has a value. | `string \| undefined` | `undefined` |
| `readonly` | `readonly` | If `true`, the user cannot modify the value. | `boolean` | `false` |
| `required` | `required` | If `true`, the user must fill in a value before submitting a form. | `boolean` | `false` |
| `size` | `size` | The initial size of the control. This value is in pixels unless the value of the type attribute is `"text"` or `"password"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored. | `number \| undefined` | `undefined` |
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/select/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ export default defineComponent({
| `multiple` | `multiple` | If `true`, the select can accept multiple values. | `boolean` | `false` |
| `name` | `name` | The name of the control, which is submitted with the form data. | `string` | `this.inputId` |
| `okText` | `ok-text` | The text to display on the ok button. | `string` | `'OK'` |
| `placeholder` | `placeholder` | The text to display when the select is empty. | `null \| string \| undefined` | `undefined` |
| `placeholder` | `placeholder` | The text to display when the select is empty. | `string \| undefined` | `undefined` |
| `selectedText` | `selected-text` | The text to display instead of the selected option's value. | `null \| string \| undefined` | `undefined` |
| `value` | `value` | the value of the select. | `any` | `undefined` |

Expand Down
Loading