PSA: Assume dir="auto" if none provided in browsers you develop.
Add dir=“auto” to your inputs and textareas
41–50 of 114 posts
Re: Add dir=“auto” to your inputs and textareas
#42or don't, because using fancy quotes in your HTML will have it not render properly. mods, pls fix the title.
Re: Add dir=“auto” to your inputs and textareas
#43Earlier quoted context omitted.
Instead of gatekeeping "the space" with insider abbreviations and belittling the author, you could appreciate that they raised awareness of the issue.
I am not "gatekeeping", I'm telling you that in spaces you don't know there's hidden complexity, and you shouldn't rely on the Internet. No amount of "awareness" is taking that away. Also, please tell me where I "belittled" the author.
Re: Add dir=“auto” to your inputs and textareas
#44A number of other automatic behaviors exist simply when you change your primary language, and this is one of them that should change by default. You'll know this by experience if you speak another language and occasionally flip your primary language over. All the sites you browse start respecting your lang and locale settings.
Other technical or format-specific inputs should retain their relevant direction.
Re: Add dir=“auto” to your inputs and textareas
#45Why in 2023 is this still an issue? Frameworks and browsers should be designed that if you totally ignore rtl support, the browser/framework just does some usable default. Just like if you don't set a font size, the browser chooses one for you. Or if you don't specify the background color, one is chosen for you.
But in general, i don't think there is a right answer that works in all cases. The existing defaults (bidi algorithm) do make a best guess that is probably the best guess possible.
Re: Add dir=“auto” to your inputs and textareas
#46Why isn't this the default?
Dir=auto means ignore what came previously when trying to guess what direction this text is. Not setting a dir attribute means the browser should use the text in the parent/previous sibling element for figuring out what direction this element's text is. Auto might make sense as a default for a where user input is disconnected from the html, but would be a horrible default for most tags like
Re: Add dir=“auto” to your inputs and textareas
#47Yeah, as far as I'm concerned, this is a deficiency of language detection. Specific types of input types should auto rtl based on the user agent's locale usage. A number of other automatic behaviors exist simply when you change your primary language, and this is one of them that should change by default. You'll know this by experience if you speak another language and occasionally flip your primary language over. All…
In the meantime, browser plug-in?
Re: Add dir=“auto” to your inputs and textareas
#48This is indeed an easy way to fix text rendering in your inputs and textareas. However, you'll also need to do the same for elements that render the submitted text. And once you encounter bidirectional text (e.g. an English product name within an Arabic paragraph), that opens up another whole can of worms... Note also that there's currently a regression in Chrome that affects how RTL text is rendered in inputs with d…
[flagged]
Re: Add dir=“auto” to your inputs and textareas
#49Why isn't this the default?
I imagine backwards compat is a big part, but also: Dir=auto means ignore what came previously when trying to guess what direction this text is. Not setting a dir attribute means the browser should use the text in the parent/previous sibling element for figuring out what direction this element's text is. Auto might make sense as a default for a where user input is disconnected from the html, but would be a horrible d…