Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions angular/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ export class IonRow {
}

export declare interface IonSearchbar extends Components.IonSearchbar {}
@Component({ selector: 'ion-searchbar', changeDetection: ChangeDetectionStrategy.OnPush, template: '<ng-content></ng-content>', inputs: ['animated', 'autocomplete', 'autocorrect', 'cancelButtonIcon', 'cancelButtonText', 'clearIcon', 'color', 'debounce', 'disabled', 'mode', 'placeholder', 'searchIcon', 'showCancelButton', 'spellcheck', 'type', 'value'] })
@Component({ selector: 'ion-searchbar', changeDetection: ChangeDetectionStrategy.OnPush, template: '<ng-content></ng-content>', inputs: ['animated', 'autocomplete', 'autocorrect', 'cancelButtonIcon', 'cancelButtonText', 'clearIcon', 'color', 'debounce', 'disabled', 'inputmode', 'mode', 'placeholder', 'searchIcon', 'showCancelButton', 'spellcheck', 'type', 'value'] })
export class IonSearchbar {
ionInput!: EventEmitter<CustomEvent>;
ionChange!: EventEmitter<CustomEvent>;
Expand All @@ -692,7 +692,7 @@ export class IonSearchbar {
}
}
proxyMethods(IonSearchbar, ['setFocus', 'getInputElement']);
proxyInputs(IonSearchbar, ['animated', 'autocomplete', 'autocorrect', 'cancelButtonIcon', 'cancelButtonText', 'clearIcon', 'color', 'debounce', 'disabled', 'mode', 'placeholder', 'searchIcon', 'showCancelButton', 'spellcheck', 'type', 'value']);
proxyInputs(IonSearchbar, ['animated', 'autocomplete', 'autocorrect', 'cancelButtonIcon', 'cancelButtonText', 'clearIcon', 'color', 'debounce', 'disabled', 'inputmode', 'mode', 'placeholder', 'searchIcon', 'showCancelButton', 'spellcheck', 'type', 'value']);

export declare interface IonSegment extends Components.IonSegment {}
@Component({ selector: 'ion-segment', changeDetection: ChangeDetectionStrategy.OnPush, template: '<ng-content></ng-content>', inputs: ['color', 'disabled', 'mode', 'scrollable', 'value'] })
Expand Down
1 change: 1 addition & 0 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ ion-searchbar,prop,clearIcon,string | undefined,undefined,false,false
ion-searchbar,prop,color,string | undefined,undefined,false,false
ion-searchbar,prop,debounce,number,250,false,false
ion-searchbar,prop,disabled,boolean,false,false,false
ion-searchbar,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url",'search',false,false
ion-searchbar,prop,mode,"ios" | "md",undefined,false,false
ion-searchbar,prop,placeholder,string,'Search',false,false
ion-searchbar,prop,searchIcon,string,'search',false,false
Expand Down
8 changes: 8 additions & 0 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,10 @@ export namespace Components {
*/
'getInputElement': () => Promise<HTMLInputElement>;
/**
* A hint to the browser for which keyboard to display. Possible values are: `"none"` | `"text"` | `"tel"` | `"url"` | `"email"` | `"numeric"` | `"decimal"` | `"search"`.
*/
'inputmode': 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
/**
* The mode determines which platform styles to use.
*/
'mode'?: "ios" | "md";
Expand Down Expand Up @@ -5440,6 +5444,10 @@ declare namespace LocalJSX {
*/
'disabled'?: boolean;
/**
* A hint to the browser for which keyboard to display. Possible values are: `"none"` | `"text"` | `"tel"` | `"url"` | `"email"` | `"numeric"` | `"decimal"` | `"search"`.
*/
'inputmode'?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
/**
* The mode determines which platform styles to use.
*/
'mode'?: "ios" | "md";
Expand Down
55 changes: 34 additions & 21 deletions core/src/components/searchbar/readme.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions core/src/components/searchbar/searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export class Searchbar implements ComponentInterface {
*/
@Prop() disabled = false;

/**
* A hint to the browser for which keyboard to display.
* Possible values are: `"none"` | `"text"` | `"tel"` | `"url"` | `"email"` | `"numeric"` | `"decimal"` | `"search"`.
*/
@Prop() inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' = 'search';

/**
* Set the input's placeholder.
* `placeholder` can accept either plaintext or HTML as a string.
Expand Down Expand Up @@ -442,6 +448,7 @@ export class Searchbar implements ComponentInterface {
disabled={this.disabled}
ref={el => this.nativeInput = el}
class="searchbar-input"
inputMode={this.inputmode}
onInput={this.onInput}
onBlur={this.onBlur}
onFocus={this.onFocus}
Expand Down
4 changes: 4 additions & 0 deletions core/src/components/searchbar/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ <h5 class="ion-padding-start ion-padding-top"> Search - Cancel Button set to tru
<ion-searchbar id="noCancel" value="after view" autocorrect="off" autocomplete="off" spellcheck="true" type="text" show-cancel-button="focus">
</ion-searchbar>

<h5 class="ion-padding-start ion-padding-top"> Search - Input mode set to numeric</h5>
<ion-searchbar id="noCancel" value="after view" inputmode="numeric" autocorrect="off" autocomplete="off" spellcheck="true" type="text" show-cancel-button="focus">
</ion-searchbar>

<h5 class="ion-padding-start ion-padding-top"> Search - Disabled </h5>
<ion-searchbar id="disabled" value="disabled" type="text" disabled="true">
</ion-searchbar>
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/searchbar/usage/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<!-- Searchbar with telephone type -->
<ion-searchbar type="tel"></ion-searchbar>

<!-- Searchbar with numeric inputmode -->
<ion-searchbar inputmode="numeric"></ion-searchbar>

<!-- Searchbar disabled -->
<ion-searchbar disabled="true"></ion-searchbar>

Expand Down
3 changes: 3 additions & 0 deletions core/src/components/searchbar/usage/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<!-- Searchbar with telephone type -->
<ion-searchbar type="tel"></ion-searchbar>

<!-- Searchbar with numeric inputmode -->
<ion-searchbar inputmode="numeric"></ion-searchbar>

<!-- Searchbar disabled -->
<ion-searchbar disabled="true"></ion-searchbar>

Expand Down
9 changes: 6 additions & 3 deletions core/src/components/searchbar/usage/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export const SearchbarExample: React.FunctionComponent = () => (
<IonContent>
{/*-- Default Searchbar --*/}
<IonSearchbar></IonSearchbar>

{/*-- Searchbar with cancel button always shown --*/}
<IonSearchbar showCancelButton="always"></IonSearchbar>

{/*-- Searchbar with cancel button never shown --*/}
<IonSearchbar showCancelButton="never"></IonSearchbar>

{/*-- Searchbar with cancel button shown on focus --*/}
<IonSearchbar showCancelButton="focus"></IonSearchbar>

Expand All @@ -25,6 +25,9 @@ export const SearchbarExample: React.FunctionComponent = () => (
{/*-- Searchbar with telephone type --*/}
<IonSearchbar type="tel"></IonSearchbar>

{/*-- Searchbar with numeric inputmode --*/}
<IonSearchbar inputmode="numeric"></IonSearchbar>

{/*-- Searchbar disabled --*/}
<IonSearchbar disabled={true}></IonSearchbar>

Expand Down
3 changes: 3 additions & 0 deletions core/src/components/searchbar/usage/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<!-- Searchbar with telephone type -->
<ion-searchbar type="tel"></ion-searchbar>

<!-- Searchbar with numeric inputmode -->
<ion-searchbar inputmode="numeric"></ion-searchbar>

<!-- Searchbar disabled -->
<ion-searchbar disabled="true"></ion-searchbar>

Expand Down