diff --git a/angular/src/directives/proxies.ts b/angular/src/directives/proxies.ts index 011fbf27a1..183c8ebb27 100644 --- a/angular/src/directives/proxies.ts +++ b/angular/src/directives/proxies.ts @@ -328,8 +328,8 @@ export class IonInfiniteScrollContent { } export declare interface IonInput extends Components.IonInput { } -@ProxyCmp({ inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"], "methods": ["setFocus", "getInputElement"] }) -@Component({ selector: "ion-input", changeDetection: ChangeDetectionStrategy.OnPush, template: "", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }) +@ProxyCmp({ inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"], "methods": ["setFocus", "getInputElement"] }) +@Component({ selector: "ion-input", changeDetection: ChangeDetectionStrategy.OnPush, template: "", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "debounce", "disabled", "enterkeyhint", "inputmode", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "size", "spellcheck", "step", "type", "value"] }) export class IonInput { ionInput!: EventEmitter; ionChange!: EventEmitter; diff --git a/core/api.txt b/core/api.txt index a68f92c253..b137751dab 100644 --- a/core/api.txt +++ b/core/api.txt @@ -439,6 +439,7 @@ ion-input,prop,clearOnEdit,boolean | undefined,undefined,false,false ion-input,prop,color,string | undefined,undefined,false,false ion-input,prop,debounce,number,0,false,false ion-input,prop,disabled,boolean,false,false,false +ion-input,prop,enterkeyhint,"done" | "enter" | "go" | "next" | "previous" | "search" | "send" | undefined,undefined,false,false ion-input,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined,undefined,false,false ion-input,prop,max,string | undefined,undefined,false,false ion-input,prop,maxlength,number | undefined,undefined,false,false diff --git a/core/package.json b/core/package.json index e4910efc6f..1d6700429d 100644 --- a/core/package.json +++ b/core/package.json @@ -34,7 +34,7 @@ "tslib": "^1.10.0" }, "devDependencies": { - "@stencil/core": "1.12.0", + "@stencil/core": "1.12.4", "@stencil/sass": "1.3.1", "@types/jest": "24.9.0", "@types/node": "12.12.3", diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 7bd5fba0f1..bdc14d5800 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -843,6 +843,10 @@ export namespace Components { * If `true`, the user cannot interact with the input. */ "disabled": boolean; + /** + * A hint to the browser for which enter key to display. Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, `"previous"`, `"search"`, and `"send"`. + */ + "enterkeyhint"?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; /** * Returns the native `` element used under the hood. */ @@ -4095,6 +4099,10 @@ declare namespace LocalJSX { * If `true`, the user cannot interact with the input. */ "disabled"?: boolean; + /** + * A hint to the browser for which enter key to display. Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, `"previous"`, `"search"`, and `"send"`. + */ + "enterkeyhint"?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; /** * A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`. */ diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx index 9af046d98b..f08d7118f8 100644 --- a/core/src/components/input/input.tsx +++ b/core/src/components/input/input.tsx @@ -95,6 +95,13 @@ export class Input implements ComponentInterface { */ @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; + /** + * A hint to the browser for which enter key to display. + * Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, + * `"previous"`, `"search"`, and `"send"`. + */ + @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; + /** * The maximum value, which must not be less than its minimum (min attribute) value. */ @@ -362,6 +369,7 @@ export class Input implements ComponentInterface { autoComplete={this.autocomplete} autoCorrect={this.autocorrect} autoFocus={this.autofocus} + enterKeyHint={this.enterkeyhint} inputMode={this.inputmode} min={this.min} max={this.max} diff --git a/core/src/components/input/readme.md b/core/src/components/input/readme.md index f66856769f..237ca52e5a 100644 --- a/core/src/components/input/readme.md +++ b/core/src/components/input/readme.md @@ -242,6 +242,7 @@ export const InputExamples: React.FC = () => { | `color` | `color` | The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). | `string \| undefined` | `undefined` | | `debounce` | `debounce` | Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. | `number` | `0` | | `disabled` | `disabled` | If `true`, the user cannot interact with the input. | `boolean` | `false` | +| `enterkeyhint` | `enterkeyhint` | A hint to the browser for which enter key to display. Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, `"previous"`, `"search"`, and `"send"`. | `"done" \| "enter" \| "go" \| "next" \| "previous" \| "search" \| "send" \| undefined` | `undefined` | | `inputmode` | `inputmode` | A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`. | `"decimal" \| "email" \| "none" \| "numeric" \| "search" \| "tel" \| "text" \| "url" \| undefined` | `undefined` | | `max` | `max` | The maximum value, which must not be less than its minimum (min attribute) value. | `string \| undefined` | `undefined` | | `maxlength` | `maxlength` | If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter. | `number \| undefined` | `undefined` |