If we’re collecting anecdata, I installed Fedora fresh on a framework a couple months ago. I like the cohesiveness of GNOME these days but i’ve seen a couple of issues like non stop notification bells on repeat or inability to wake screen when plugged in to a monitor that feel not prod ready.
I don’t know that i’d expect windows to be much better either, but that’s my experience.
Of course it does. tabindex=0 doesn't sort naturally into the automatic tabindex order, it sorts AFTER everything. So you are jumping through all the other tabindex elements, then you are jumping back to all tabindex=0.
> That's the same behavior as a <button> without tabindex, like the author is proposing.
Yes, but often you have elements with taborder > 0.
> It's generally advised not to set tabindex to anything but 0 or -1 and let the document order dictate tab order.
Only if document order is sane. Usually with modern websites it isn't, document order is a broken notion if you can position elements at will and e.g. put navigation at the bottom of a document but move it to the top by CSS. Which is actually a recommendation that some people make for acessibility...
What you usually want to do is assign a sensible taborder > 0 to the one form element that the user is probably currently using. Otherwise, he will pointlessly tab through search, menus, cookie bars and a ton of other pointless stuff first.
You almost certainly don't want to assign tab order manually. Theoretically, if your html is out-of-order for some reason, then you can fix it with taborder, but there are so many issues with out-of-order html that it's much better to avoid that in the first place. Even on modern websites, it is almost always easier to lay your html out in the correct order rather than messing around with the order via CSS. (I read an article recently by a web accessibility expert that discussed the issue of flexbox's order parameter and how the working group designing it failed to accessibility into account when adding it to the spec: https://alice.boxhall.au/articles/a-threat-model-for-accessi...)
You mention using it to skip a nav header or something similar, but (1) you have autofocus for that if you need it (and you don't usually need it), and (2) the pattern where you provide a "jump to content" button is typically a better approach, because it allows the user to decide what they want to do when they arrive on your site, rather than you deciding for them. If the "jump to content" button behind visible when focused and is the first element on the screen, then it works perfectly for screen readers and other keyboard users, and you don't need to handle taborder manually.
There are always exceptions to these sorts of rules, and some times tabindex might be necessary, but I've not yet come across a case where the problem couldn't be solved better in a different way.
> Yes, but often you have elements with taborder > 0.
You can just as easily apply the same tabindex to a div though.
> Only if document order is sane. Usually with modern websites it isn't...
Well that's the real problem, all your non-interactive content (like text) is going to be out of order too. You're just adding to the confusion if buttons and other inputs are in a different order from the content they're associated with.
> Otherwise, he will pointlessly tab through search, menus, cookie bars and a ton of other pointless stuff first.
The proper way of dealing with this is a "Skip to Main Content" element:
No, it isn't the proper way. That only works if you can see the skip link and know to press enter. Otherwise you will tab straight into the navigation. So possibly useful for screen readers, but completely useless for most keyboard users. Yet another stupid webdev workaround for a selfimposed problem.
What you should do is autofocus the first form element (if there is a form), give it tabindex=1 and number the other form elements in a sensible ascending tabindex order. Otherwise, proper semantic markup is sufficient, even for screen readers.
Your solution of focusing the first form element is pretty idiosyncratic. It's better to follow WAI patterns, because patterns have predictable behavior. Otherwise, keyboard users will have to learn how to interact with your website from scratch, instead of just following the same pattern they're used to from other sites.
I would be very surprised if a website autofocused almost anything on page load, except for very specific applications where that makes sense. I just tried clicking through some forms on gov.uk, which is a website that has spent a _lot_ of time testing and improving the UX of their forms, and none of them had autofocused elements, not even on later pages after having already filled in elements.
I can imagine screen readers would deal particularly poorly with this behaviour, because the user would be dropped in a field without any of the context of the page, just the field label to work with. However, I've not been able to test that out properly.
I don't think the behaviour you're describing is anywhere near as common as you think it is, and I suspect it would make a page less accessible for a number of kinds of users.
I'm saying tabindex=0 is naturally sorted wrt other naturally focusable elements. That matches the behavior of the <button> you're trying to emulate. I don't know what tabindex>0 has to do with this.
That is correct. From your link: "tabindex="0" means that the element should be focusable in sequential keyboard navigation, after any positive tabindex values. The focus navigation order of these elements is defined by their order in the document source.
"
tabindex=0 does sort naturally into the automatic tabindex order.
> So you are jumping through all the other tabindex elements
This part is correct (for elements with an explicit positive tabindex), which is why specifying an explicit positive tabindex is considered a code smell. If you don’t specify a tabindex on an element that’s focusable by default, it behaves like tabindex=0.
The issue isn't with tabindex=0 specifically, but fucking with tabindex in general. People go down that path, and start putting that shit on everything, like it's Frank's Red Hot.
And in my experience, the same folks who use div's instead of button's are the ones who don't know better and start throwing tabindex around.
"why do you need to listen for events at the document level?"
Not events generally, keydown events specifically, which do not fire on child elements of the document.
Hi, good premise overall, but there are just a lot of little things that are off.
- It only counts as "fucking with tabindex" if you give it a value that's not 0 or -1. You should give that specific disclaimer, because there are uses for tabindex=0 other than reimplementing <button>.
- Divs can definitely receive keydown events. If I go to an arbitrary web page, pick a div and run `div.tabIndex = 0;` + `div.addEventListener('keydown', console.log);`, I see those events coming through when I have the div keyboard-focused.
- "Run your code, somehow..." I think just calling `notRealBtn.click()` is the best option.
- Stupid but semi-interesting nitpick: 'keydown' is good for enter, but you should be listening to 'keyup' for the space bar. That's how real <button>s work anyway.
- The 'keyup' listener should call event.preventDefault() to prevent the default behavior of the space bar scrolling the page.
> Not events generally, keydown events specifically, which do not fire on child elements of the document.
Are you sure? I have a 17 year old HTML tool written using plain, vanilla JavaScript where keydown on a child element seems to have been working as expected.
I think that’s because it’s an input and not a div, so it can get focus. Im not sure whether tabindex is enough to make a div do that too, article suggests no
How do you gain the confidence that what you choose to ignore is safe to ignore?
Computer damage is one potential consequence on the extreme end. On the conservative end, the software might just not work the way you want and you waste your time. It’s a mental model you have to develop. Even as a technical power user though, I want to reduce the risk of wasting my time, or even confront the possibility that I might waste my time, if I don’t have to.
How do you know the software in the article will do what you want?
For handbrake you can pick a preset and see what happens. Or don't even do that: when you open it it'll make you pick a video file, then you can just jam the green start button and see if it gives you what you need. Very little time spent.
Right, you don't know if either program is the right thing just by looking at it. The reason you're uncertain isn't all those options handbrake shows. You have that uncertainty no matter what. You need the same confidence with or without options. So that problem, while real, isn't an argument against showing options.
And as far as time goes, it only takes a few seconds in either scenario. You hit go, you see the progress bar is moving, you check your file a few minutes later.
if the UI is forcing me to look at these options before pressing Go, it is a signal that someone thought these were important to consider before i pressed Go. this is the gricean maxims of quantity and relation.
the decision to ignore this signal is a learned behavior that you and i have, is all i’m saying
The average person doesn't even read error messages. They know how to ignore things and hit the button that goes forward just fine. If they choose not to try the program, that's different. They don't lack the skill. (A child might lack this skill but a child is curious enough to push on so it works out anyway.)
I don’t really understand what you’re arguing anymore. Is the average person afraid of the unknown or are they capable of ignoring things?
You seem comfortable with the idea that a child not having this learned skill. I don’t know why you don’t extend that empathy towards the inexperienced in general.
My interpretation was that you're implying a big fraction of adults don't have this skill, that a typical non-technical person likely doesn't have it. I'm saying nearly every adult does have it. So I have empathy for those that truly lack it, the 1% of adults, but that empathy doesn't extend to the rest that aren't suffering that issue.
It's the JSON data payload that has unminified keys. Though YouTube is one of the few google sites that still use JSON, most use protocol buffers which generate JS interfaces which would indeed be mangled by minifiers.
Just treat it (TL) as a job and have external hobbies that you really have passion for. Or perhaps do less days a week and spend time on things you have passion for. The comp can really make a big difference when you are older and retired
Why do you want money? As any financial advisor worth their salt would tell you, money is a means to an end, not an end in itself, and it's up to you to decide what those ends are.
It's very possible that you'd be perfectly happy on less comp, in a role that's more fulfilling. IME, this is a fact that people realize 4ish years into a high-earning career.
For me, I realized that being happy every day is immeasurably more important to me than making a marginal pre-tax $150k/year, and that the FAANG environments are intentionally designed to be incompatible with what brings me happiness, day-to-day. YMMV.
I don’t know that i’d expect windows to be much better either, but that’s my experience.