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

Add HTML inputmode attribute #2226

Closed
wants to merge 5 commits into from

Conversation

NiedziolkaMichal
Copy link
Member

This is interactive example for global attribute inputmode.

image

Copy link
Contributor

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

I think it would be helpful to understand, here, for the example to help express why we should use something like inputmode=email rather than <input type="email"....

Especially given stuff like this in the page:

Inputs that require email addresses should typically use <input type="email"> instead.

I found this article helpful: https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/ (as often happens, CSS tricks is more helpful to me than MDN :(.

For instance:

Using the numeric value with an input of type="text" may actually make more sense than setting the input to type="number" alone because, unlike a , inputmode="numeric" can be used with maxlength, minlength and pattern attributes, making it more versatile for different use cases.

...so maybe we could craft an example where we want to use some of these attributes? Not sure what though. Maybe "enter an 8 digit code":

<label> Enter an 8-digit code:
  <input type="text" maxlength="8"
         inputmode="numeric" pattern="[0-9]*"
         value="42">
</label>

?

Similarly this, for url:

The url value provides a handy shortcut for users to append TLDs (e.g. .com or .co.uk) with a single key, as well keys typically used in web addresses, like the dot (.) and forward slash (/) characters. The exact TLD displayed on the keyboard is tied to the user’s locale.

This could also be a useful keyboard to show users if your input accepts domain names (e.g. css-tricks.com) as well as full URIs (e.g. https://css-tricks.com). Use type="url" instead if your input requires validating the input.

...seems like it could be the basis of a good example.

@bsmth bsmth changed the title inputmode Add HTML inputmode attribute Dec 7, 2022
@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Jan 7, 2023
@NiedziolkaMichal NiedziolkaMichal mentioned this pull request Feb 10, 2023
94 tasks
@github-actions
Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the idle Issues and pull requests with no activity for three months. label Jul 21, 2023
@Josh-Cena Josh-Cena added the Content:HTML issues related to HTML examples. label Jul 31, 2023
@bsmth bsmth requested a review from a team as a code owner August 23, 2023 10:39
@bsmth bsmth requested review from chrisdavidmills and removed request for a team August 23, 2023 10:39
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Hi @NiedziolkaMichal! Are you still interested in working on this example? If not, I'd be happy to finish it off.

I think @wbamberg's comment is spot on in terms of what needs to be done; I also think you should refrain from using <b> (or other similar elements commonly used for presentation) unless you are actually using it for a semantic purpose. In this case, it looks like you are using it purely for presentation, therefore <strong> would be more appropriate.

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Sep 24, 2023
@bsmth
Copy link
Member

bsmth commented Oct 31, 2023

Hi @chrisdavidmills thanks a lot for the offer to help out, do you still want to take this? @NiedziolkaMichal - I'm going to close this one for now, but let us know if you'd like to come back to it again before Chris works on it. Thanks all!

@bsmth bsmth closed this Oct 31, 2023
@chrisdavidmills
Copy link
Contributor

@bsmth yup, can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML issues related to HTML examples. idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants