Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add inputmode global HTML attribute #2573

Merged
merged 2 commits into from
Feb 6, 2025
Merged

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Jan 24, 2025

One thing that I know is an issue:

Safari's reported support differs between caniuse and BCD. Honestly, I don't know who's "wrong" in this scenario—it's not clear to me how to test whether an attribute is invalid, if there's no discernible behavior anyway.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Jan 24, 2025
@captainbrosset
Copy link
Contributor

I think BCD is correct here. inputmode is implemented in Safari across macOS and iOS. It's just a lot more visible on iOS because of the virtual keyboard. But, even on macOS the attribute does have an effect. I just tested and I get a different suggestion popups on input fields with inputmode=tel and inputmode=email than I do on other types of inputs.

The point here is that the spec doesn't say exactly what should happen. This is for the user agent to decide, depending on what works best for the user, on the particular device they're using. It makes no sense for Safari on macOS to change the keyboard, because it's a physical keyboard, so instead they use the inputmode attribute to offer some contextual auto-completion help.

Either way, the attribute, and reflected DOM property, does work on Safari macOS too.

features/inputmode.yml Outdated Show resolved Hide resolved
Co-authored-by: Patrick Brosset <patrickbrosset@gmail.com>
@ddbeck
Copy link
Collaborator Author

ddbeck commented Feb 6, 2025

Thanks, @captainbrosset. I sent a PR to caniuse to update the data there (Fyrd/caniuse#7256), so I think this is ready for re-review.

@ddbeck ddbeck requested a review from captainbrosset February 6, 2025 15:24
@ddbeck ddbeck merged commit b44c75c into web-platform-dx:main Feb 6, 2025
3 checks passed
@ddbeck ddbeck deleted the inputmode branch February 6, 2025 16:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants