3 ms·
So I decided to try and figure out this specific trick about toggling content and how well this would actually work in, say, a tab panel. I mean, it is a cute t
by cfv 8y ago
So I decided to try and figure out this specific trick about toggling content and how well this would actually work in, say, a tab panel. I mean, it is a cute trick right? I made this: https://jsfiddle.net/sr8z1mob/6/ https://jsfiddle.net/sr8z1mob/6/
Yes, it is a cute trick. Yes, it CAN be made more accessible, and kinda sorta avoids the most obvious problems with like tabindexes and so on, although it did take a lot of work on my end for such an insignificant demonstrator, and I can't still set the active tab by hand in any way in here.
Which is a rather important cue about it's capabilities.
There's other things I cannot do:
- Use this as an actual component! I would have to set up an editor expansion to type all this stuff each time I wanted a tablist, and I cannot globally modify how all of them work. Making this into some kind of custom tag would be GREAT, but it could also probably mean going back to .htc files which is not so great.
- Track user interaction! It's important to us to know what the user is doing with our product so we can make it better.
- Auto-select the first tab's content in all tablists without contorting my brain into a cramp
- Load the tab contents lazily. Maybe you don't need the King James Bible (replace with any other long blob you like) loaded in there by default, just when you actually want to go look at the thing.
- Skin the scrollbar easily (OSX for instance is a major PITA I'd like to have auto-solved for me)
- Tell the server when the tab was scrolled to the bottom
- Did I mention I cannot mark the current tab as open in any real meaningful way?
This is a fun experiment. But really, it all boils down to requirements and development times. Do you have the time and energy to spare to twist the browser into doing this kind of things? That's awesome!
I, more often than not, don't. That's sort of the reason why we use a development framework that puts us into a mindset we can work better with to cover more ellaborate scenarios (like being able to mark the currently open tab as exactly that without having to think about doing it).