-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Directionality of input element whose type attribute is in the Telephone state #6140
Comments
Seems reasonable to match implementations, though might be good to get input from @whatwg/i18n. |
Well, I would see value in making it ltr by default in most languages. Of course, developers can set the correct direction manually, but I use Hebrew RTL websites all the time, and I see that many developers don't do it, and making a better default would be nice. (I'd also love to see the same for credit card numbers.) However, it shouldn't always be ltr. Languages written in the N'Ko alphabet would have to be rtl, because they write numbers from right to left. |
@amire80 I agree with most of your comment. Telephone numbers are kind of special as input, since they are numbers that are usually separated by neutrals or spaces. Thinking out loud... Would setting the base direction to |
It looks like this is being implemented in browsers, e.g., in WebKit/WebKit#15273 and https://chromium-review.googlesource.com/c/chromium/src/+/4851878 . It's worth noting that the spec probably does require a style sheet change, in addition to the style sheet chunk proposed in #3699 (comment) , to reflect that inputs with type=tel should have
or
Otherwise we end up with the HTML spec's concept of direction not being reflected into the |
Thank you for surfacing this issue @dbaron! See also #3330 (comment) for more background as to why we want to preserve the Telephone special case after all. I think Telephone is already covered using your first suggestion: [dir]:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; } or would some further change be warranted? (I suspect #9689 is not impacted here as that would influence |
Closing this per my above comment. If there's anything I missed please do let me know. |
Indeed, I see what I was saying there was already in the style sheet. |
In the section of the dir attribute, the paragraph says:
This doesn't match what Chrome, Safari, and Firefox currently do, and rather, browsers treat it as the following contents of the paragraphs as the other elements.
I don't see a lot of value in making type=tel special. I think that we could have no special rule for directionality of input element having type=tel.
WDYT?
The text was updated successfully, but these errors were encountered: