DRAFT: Provide a simple attribute toggling plugin
Based on some internal discussions, this PR tries to provide a 'simple' plugin that can help toggle attributes or classes using html markup
Needs:
- [ ] at least tests
- [ ] feedback
- [ ] maybe a better name
https://deploy-preview-35872--twbs-bootstrap.netlify.app/docs/5.1/components/toggler/
My first question, why only click? Why not data-bs-toggle=click, data-bs-toggle=dblclick, data-bs-toggle=mousedown, data-bs-toggle=mouseenter,mouseleave (or an "alias" hover), etc.?
My first question, why only click? Why not data-bs-toggle=click, data-bs-toggle=dblclick, data-bs-toggle=mousedown, data-bs-toggle=mouseenter,mouseleave (or an "alias" hover), etc.?
Many things to implement 😋 . Future plans and thoughts here: https://github.com/twbs/bootstrap/blob/1f0545bc938734ce918ba3b3ad42fb3622a103bf/js/src/dom/magic-actions.js
But have to pass one by one
I think focusing on click is a good first step. Too many interactions could be a little messy IMO. Hover support might be interesting, but could also be tricky and can also be covered by CSS for a wide variety of situations. Would want to sit with it for a little bit I think.