-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5: Move from JS input button group toggling to all CSS #28463
Conversation
The CSS LGTM👍 IMO, it is better to move the documents to the button group page. |
Do not merge yet, @mdo, see the first post for TODO. |
c208199
to
bb0e878
Compare
And who's going to handle aria pressed?
…On Tue, Mar 12, 2019, 22:48 Mark Otto ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In js/src/button.js
<#28463 (comment)>:
>
- if (triggerChangeEvent) {
- this._element.classList.toggle(ClassName.ACTIVE)
- }
+ this._element.classList.toggle(ClassName.ACTIVE)
Yeah, we might be able to nix all the JS—can anyone confirm that? Only
reason I could see us leaving some JS for a non-input implementation is
quickly toggling active on/off, but I feel like most folks could do that
themselves with very little code and their own syntax.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#28463 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAVVtVsLpVRuedaqHbVJKgo5IdqJ9DvSks5vWBK3gaJpZM4bp4Wd>
.
|
To handle the According to @scottaohara's explanation, there is a radio button group implementation pattern without Also, his comment at the end of the article suggests a grouping of
So in terms of Pure CSS and accessibility, we'll need decide to which one:
|
that could be one method but not necessarily the only method, in that a grouping could be just a As I'm not deeply familiar with what it is you're trying to solve for here, and honestly i'm a bit confused reading through just this thread with the number of different elements being referenced, I'd definitely defer to @patrickhlauke's guidance. |
coming in late on this...so: skimming over the changes, it looks like we're going for clean CSS version here? just layering over texisting |
Yeah, the idea is to use only CSS for buttons. If we don't need to handle aria, I can update the branch dropping more stuff. |
ah, hang on...i think the confusion here is because there's two separate things going on...there's the "checkboxes and radio buttons that look like a toolbar/button strip" https://getbootstrap.com/docs/4.3/components/buttons/#checkbox-and-radio-buttons (which is what wouldn't need any JS nor I'll be honest, i find these two things related, but confusing. Most confusing that the checkbox/radio ones are under the "Buttons" documentation - should they perhaps be under their own component topic for checkbox/radio button group? |
Hmm then I'm also lost. Not sure how to proceed. Maybe we should rename |
incidentally, am i missing something, or are the groups in https://getbootstrap.com/docs/4.3/components/button-group/ not actually doing anything fancy JS wise at the moment? are they supposed to have aria-pressed and act like sets of radio buttons or not? the "button plugin" mention on there simply points back to the buttons page...so seems we're making some kind of circular reference here. worth taking a step back and deciding overall what we want. certainly the easiest part is:
Now, button groups are like an extended version of the single button that acts as a toggle. A group can be mutually exclusive (acting like a set of radio buttons) or not (like a toolbar in a wysiwyg tool, where each on/off toggle is independent - set bold, or italic, or underline, independently. Those, again, need JS. and for the mutually exclusive capability, they need JS beyond just the pure toggle JS functionality, as it needs to not only toggle Conceptually then, the single toggle button plugin thing, and button groups, probably should go into their own component documentation page together, as they're thematically related (groups build on the single toggle). Whereas the implementation using radio/checkbox is just a differently styled set of form controls? |
Answering some questions here...
If all that's true and agreeable, it sounds like we don't need any JS here or any |
not a fan of the use for dropdowns either, but can more easily rationalise that in that it groups a button and a dropdown together. less so when it's grouping only one thing (and a hidden radio/checkbox) |
incidentally, the or perhaps taking a step back, renaming |
I don't stick to the name of the Looking for a wrapper class name (alt |
btw note that even if we just reused |
@mdo let me know if you want me to have a crack at renaming |
Yep, I showed that (just adding one new class) in my original PR #25185. |
Hey @twbs/css-review and @twbs/js-review I removed QUnit and switch to Jasmine, so now your unit tests should go there: https://github.com/twbs/bootstrap/blob/master/js/src/button/button.spec.js js/tests/unit/button.js have been removed, so if you need any help do not hesitate 😉 |
@mdo just bumping this to see if it's likely to be used/picked up/worked on further... |
so...coming back to this, as i worked my socks off at the time to reorganise stuff, create some more explanations and examples, etc ... what's happening? should this all be closed? is it too far gone to salvage the bits that aren't controversial (since the creation/renaming of the class wasn't to everybody's liking)? /cc @mdo |
so... 5 months later, and still tumbleweed on this? makes me regret having put time and effort into trying to rationalise/improve stuff here to be honest... |
Who's up to do a proper rebase for this branch? 😇 |
cursed branch :) |
Just discovering this one! Looks interesting but pretty confused with all the things going on here, so if anyone's able to summarize the need, I'd be glad to help. And if not, this topic might not be clear enough! |
in very broad strokes, from what i remember, this change does the following:
|
If I understood correctly, we have three features that kind of interact with each others:
And after reading this dicussion carefully, I have a question: the first need for this PR was to remove JS. I can't see anyone in this discussion arguing to keep this JS part (except the fact that it already exists…). Am I wrong? @patrickhlauke IMHO both behaviours are to be accomplished with Is there any reason to keep mentionning the ARIA pattern here? Am I missing something? |
ARIA is still needed for toggle buttons ( |
not to keep flogging a dead horse, but... @mdo et al, any idea on this whether we want to proceed or not? |
@patrickhlauke, I'll have a look in another PR with another approach. So you're ok with dropping the js think with active classes and just rely on the CSS only label-buttons for v5? |
yes, the move to CSS only (except for controls/toggles that need |
Closing for #30650. |
Takes #25185 and starts work on the docs and JS to drop code that was previously handling active states.
/cc @ysds