Seems to me, that should be the default behavior.
Add dir=“auto” to your inputs and textareas
51–60 of 114 posts
Re: Add dir=“auto” to your inputs and textareas
#52It is so ridiculous that this doesn't happen by default. Normally I'm against breaking changes, but in this case? The default is dumb and wrong. Inclusivity should always be the starting point, and manual hacks should be the exception.
Re: Add dir=“auto” to your inputs and textareas
#53Slightly related: I recently learned that vim has `:set rl` to make a text go from right to left. (`:set norl` to come back to regular)
Re: Add dir=“auto” to your inputs and textareas
#54Sadly, both the website and the linked codepen render the source quite poorly. The period is in the wrong place! The rendered HTML is fine. I assume this is just the Unicode bidirectional algorithm failing, as it is wont to do. I imagine that a special cased algorithm that understood that HTML tags (the stuff between inclusive) should render as atomic things, internally LTR, but without imposing their direction on su…
The Unicode bidi algorithm isn't failing here, it's working as designed. The source code snippet has base direction LTR, but has mixed-direction content because of the Hebrew text. Punctuation marks have weak directionality, so the period shows up at the end of the RTL run. Since the base direction is LTR, the 'end' of the RTL run means the right side. If you want to force mixed-direction content to render correctly,…
Perhaps a syntax highlighter could learn to insert “first strong isolate” and “pop directional isolate” and to also enforce that content leaves the stack alone?
Re: Add dir=“auto” to your inputs and textareas
#55Slightly related: I recently learned that vim has `:set rl` to make a text go from right to left. (`:set norl` to come back to regular)
Re: Add dir=“auto” to your inputs and textareas
#56There is also this shortcut of ctrl+shift+x to switch to RTL. Which is really funny when you do it on Twitter since it flips the entire user interface.
Re: Add dir=“auto” to your inputs and textareas
#57This 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
#58Why isn't it done by default by the browser? What is the browser default? (Strangely, MDN docs don't seem to indicate.) And if it's not already this, why not?
Re: Add dir=“auto” to your inputs and textareas
#59This seems like an odd thing for developers to have to do. Why isn't it done by default by the browser? What is the browser default? (Strangely, MDN docs don't seem to indicate.) And if it's not already this, why not?