Skip to content

Conversation

5im0n
Copy link
Contributor

@5im0n 5im0n commented Aug 2, 2019

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Ionic searchbar component can now have a inputmode property.
The default value is set to search. https://developer.mozilla.org/fr/docs/Web/HTML/Attributs_universels/inputmode

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ionitron-bot ionitron-bot bot added package: angular @ionic/angular package package: core @ionic/core package labels Aug 2, 2019
* 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"`.
*/
@Prop() inputmode = 'search';
Copy link
Contributor

@manucorporat manucorporat Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a well-known set of values why not define it in the type itself:

Suggested change
@Prop() inputmode = 'search';
@Prop() inputmode: 'verbatim' | 'latin' | 'latin-name' | 'latin-prose' | 'full-width-latin' | 'kana' | 'katakana', 'numeric' | 'tel' | 'email' | 'url' = 'search';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It make sence, but I think we should review the set of values.
As we can read in the HTML spec somes attributes like latin, latin-prose... doens't exist.

As the spec say, i suggest:

@Prop() inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' = 'search';

We should update the inputmode for the ion-input component as well !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, it should be based in what the spec says, and updating ion-inputs would be great but i would update ion-input in a different PR though, it might be a breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I push a new commit to set the default values that match the specs.

Do you want that a create a new PR to do the same thing on the ion-input ?

@manucorporat manucorporat merged commit 1187dc2 into ionic-team:master Aug 8, 2019
@5im0n 5im0n deleted the feat-searchbar-inputmode branch August 19, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants