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

Specify expected behavior for when users change input field directionality #9244

Open
zcorpan opened this issue May 2, 2023 · 1 comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. topic: editing topic: forms

Comments

@zcorpan
Copy link
Member

zcorpan commented May 2, 2023

The spec infers but doesn't say explicitly that users can change the directionality of input fields. For the dirname attribute to properly submit the user-set directionality, this action needs to set the dir attribute on the element. Session restore also seems to assume in a note that that is how it should work.

Chromium, WebKit and Gecko allow users to change directionality and all set the dir attribute when doing so, at least for (some) input and textarea elements. See https://www.w3.org/International/questions/qa-html-dir#userexplicit (contrary to what is currently stated there, Firefox does set dir: w3c/i18n-drafts#469).

For contenteditable it's not interoperable: Gecko sets dir on the body element (bug 962015), Chromium sets style="direction: rtl;" on all paragraphs in the editable host (inserting a div if neccessary), WebKit sets style="direction: rtl;" on the selected paragraph (inserting a div if neccessary). I think Gecko's behavior is not great since it affects the entire page, not just the editable area. But using dir seems better than style. I suppose per-paragraph directionality is better than per editing host.

cc @whatwg/forms @vinhill

@zcorpan zcorpan added topic: forms i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. topic: editing labels May 2, 2023
@annevk
Copy link
Member

annevk commented May 2, 2023

cc @rniwa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. topic: editing topic: forms
Development

No branches or pull requests

2 participants