Live data from Hacker News

Add dir=“auto” to your inputs and textareas

mough.xyz

71–80 of 114 posts

Re: Add dir=“auto” to your inputs and textareas

#71

dir is a global attribute that can be set on any HTML element: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att... What I don’t understand is why dir="auto" isn’t set as the default value, allowing browsers to choose text direction based on the lang attribute or the text content.

It affects float direction. Imagine the browser detecting Arabic text and suddenly all your float lefts are floating right. Switching it from one side to the other will completely break a lot of layouts, particularly older ones.

Re: Add dir=“auto” to your inputs and textareas

#72

On a related note, support for "logical properties/values"[1] has become mature in recent years. These are alternatives to directional-based properties (top/left/bottom/right) which are adaptable to switching content/text directions. [1] https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical...

These have been standard on mobile platforms for a long time now (e.g. "leading" and "trailing" on iOS), good to see them making their way onto the web. They make building a language-agnostic UI a much more reasonable task.

Re: Add dir=“auto” to your inputs and textareas

#73

Earlier quoted context omitted.

Thats fine, but then you say "we're going to make a new html6, and if you put DOCTYPE html6 at the start of your page, then legacy behaviours like that will be dropped and we'll start doing the right thing by default"

And there's absolutely no problem with it. Except that it won't happen due to the standard bodies losing face after they made a lot of noise with their decision that HTML 5 was the one true standard that would never get replaced.

Microsoft also acted like Win10 would be the last one, and here we are with Windows 11. I doubt anyone gave a damn about that. Normies don't have values when faced with not getting their shiny.

What should be more damning, IMO, is that there are barely any grassroots or community members on WHATWG, who has acted like they are more important than W3C. Both have drafted and approved of things that have damaged the Web. I am looking forward to the inevitable protocol split between "linkable documents" and "apps in a common virtual machine". The complexity desired from web app authors is directly opposed to the sort of things that plain HTML and CSS were doing 15-20 years ago.

It'd be nice if Google and friends just worked on the app side of things, on their own protocol, instead of commandeering the Web.

Re: Add dir=“auto” to your inputs and textareas

#74

dir is a global attribute that can be set on any HTML element: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att... What I don’t understand is why dir="auto" isn’t set as the default value, allowing browsers to choose text direction based on the lang attribute or the text content.

[deleted]

Re: Add dir=“auto” to your inputs and textareas

#75

To the people wondering why this is still an issue: Most tech is very US- or west-centered. My name contains an Umlaut (ü), which causes me trouble much more often than should be the case. A colleague of mine even changed their name by substituting ä foe ae, to avoid this issue. We still have the benefit of mostly ASCII names mind you. It can get a lot worse.

[deleted]

Re: Add dir=“auto” to your inputs and textareas

#76
post #34

Earlier 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.

Uh.

It was probably the uh. I don't fault you for thinking it might be something else.

Re: Add dir=“auto” to your inputs and textareas

#77
post #2

This 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…

https://bugs.chromium.org/p/chromium/issues/detail?id=147072...

Re: Add dir=“auto” to your inputs and textareas

#78
post #15

Uh. If I search for textarea and BiDi text, in pretty much all variations I can think of https://www.w3.org/International/talks/1602-oman is one of the top links. And right in there, the "What if you don't know the direction in advance" section, https://www.w3.org/International/talks/1602-oman/#advance I assume the problem is that the author doesn't really know the space, and so didn't even know that "BiDi" is the ri…

Instead of gatekeeping "the space" with insider abbreviations and belittling the author, you could appreciate that they raised awareness of the issue.

At what point is someone 'allowed' to criticize an author's approach and point out another that would have made their struggle shorter?

Accusations of gatekeeping should be accompanied with evidence of malice if they are to be taken seriously. Correcting (or, more like augmenting) someone speaking authoritatively on something is not gatekeeping. Also, gatekeeping has a social value, when used at the right time in the right circumstances. Bouncers literally keep the gate at a venue. Relevant experience in a given field is often necessary to have high-level (or in-depth) conversations about something within said field. If you have a group of people comparing sorting algorithms and some dude rolls up to offer his opinion without even understanding what a sorting algorithm is, would you 'appreciate' their uninformed and uninsightful take on something, lacking the shared knowledge of your group? Or would you rather clarify where the guy is wrong, refer him to a resource, and tell him to come back when he knows a bit more about what he's talking about?

Don't get hung up on details here. It's not about sorting algorithms. It's about 'deep knowledge' in a field needing to be shared to elevate discussion, for lack of a better descriptor.

Gatekeeping becomes a problem when it's mean, when it isn't helping anyone learn more, and when it's not protecting a culture or improving discussion in any meaningful way. Helping newbies learn from better sources is arguably gatekeeping -- it's just not considered harmful.

Now if we could do something about baseless accusations...

Re: Add dir=“auto” to your inputs and textareas

#80

Slightly 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)

and old vim has vim -A to start in arabic mode too (I have no idea how to use it, seems to use some input method.)
Post reply on HN