Skip to content

Commit 3e63b3c

Browse files
5im0nbrandyscarney
authored andcommitted
fix(input): update inputmode attribute values to match the specs (#19131)
1 parent d4db3af commit 3e63b3c

File tree

6 files changed

+42
-40
lines changed

6 files changed

+42
-40
lines changed

core/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ ion-input,prop,clearOnEdit,boolean | undefined,undefined,false,false
431431
ion-input,prop,color,string | undefined,undefined,false,false
432432
ion-input,prop,debounce,number,0,false,false
433433
ion-input,prop,disabled,boolean,false,false,false
434-
ion-input,prop,inputmode,string | undefined,undefined,false,false
434+
ion-input,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined,undefined,false,false
435435
ion-input,prop,max,string | undefined,undefined,false,false
436436
ion-input,prop,maxlength,number | undefined,undefined,false,false
437437
ion-input,prop,min,string | undefined,undefined,false,false

core/src/components.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -959,9 +959,9 @@ export namespace Components {
959959
*/
960960
'getInputElement': () => Promise<HTMLInputElement>;
961961
/**
962-
* A hint to the browser for which keyboard to display. This attribute applies when the value of the type attribute is `"text"`, `"password"`, `"email"`, or `"url"`. Possible values are: `"verbatim"`, `"latin"`, `"latin-name"`, `"latin-prose"`, `"full-width-latin"`, `"kana"`, `"katakana"`, `"numeric"`, `"tel"`, `"email"`, `"url"`.
962+
* A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
963963
*/
964-
'inputmode'?: string;
964+
'inputmode'?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
965965
/**
966966
* The maximum value, which must not be less than its minimum (min attribute) value.
967967
*/
@@ -2184,7 +2184,7 @@ export namespace Components {
21842184
*/
21852185
'getInputElement': () => Promise<HTMLInputElement>;
21862186
/**
2187-
* A hint to the browser for which keyboard to display. Possible values are: `"none"` | `"text"` | `"tel"` | `"url"` | `"email"` | `"numeric"` | `"decimal"` | `"search"`.
2187+
* A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
21882188
*/
21892189
'inputmode': 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
21902190
/**
@@ -4449,9 +4449,9 @@ declare namespace LocalJSX {
44494449
*/
44504450
'disabled'?: boolean;
44514451
/**
4452-
* A hint to the browser for which keyboard to display. This attribute applies when the value of the type attribute is `"text"`, `"password"`, `"email"`, or `"url"`. Possible values are: `"verbatim"`, `"latin"`, `"latin-name"`, `"latin-prose"`, `"full-width-latin"`, `"kana"`, `"katakana"`, `"numeric"`, `"tel"`, `"email"`, `"url"`.
4452+
* A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
44534453
*/
4454-
'inputmode'?: string;
4454+
'inputmode'?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
44554455
/**
44564456
* The maximum value, which must not be less than its minimum (min attribute) value.
44574457
*/
@@ -5446,7 +5446,7 @@ declare namespace LocalJSX {
54465446
*/
54475447
'disabled'?: boolean;
54485448
/**
5449-
* A hint to the browser for which keyboard to display. Possible values are: `"none"` | `"text"` | `"tel"` | `"url"` | `"email"` | `"numeric"` | `"decimal"` | `"search"`.
5449+
* A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
54505450
*/
54515451
'inputmode'?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
54525452
/**

core/src/components/input/input.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ export class Input implements ComponentInterface {
9090

9191
/**
9292
* A hint to the browser for which keyboard to display.
93-
* This attribute applies when the value of the type attribute is `"text"`, `"password"`, `"email"`, or `"url"`. Possible values are: `"verbatim"`, `"latin"`, `"latin-name"`, `"latin-prose"`, `"full-width-latin"`, `"kana"`, `"katakana"`, `"numeric"`, `"tel"`, `"email"`, `"url"`.
93+
* Possible values: `"none"`, `"text"`, `"tel"`, `"url"`,
94+
* `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
9495
*/
95-
@Prop() inputmode?: string;
96+
@Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
9697

9798
/**
9899
* The maximum value, which must not be less than its minimum (min attribute) value.

0 commit comments

Comments
 (0)