0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-12 00:08:59 +01:00
Bootstrap/js/tests/unit
Patrick H. Lauke 24abed1336 Fix keyboard handling of button-style checkbox/radio button groups (#28834)
- adds more defensive checks to make sure no unnecessary toggling happens on disabled buttons; this also fixes an up-to-now undiscovered bug where a toggle button with `.disabled` class would still have its `aria-pressed` toggled
- adds a set of explicit tests for the above case of disabled buttons and `aria-pressed`
- remove a now irrelevant (or at least very nonsensical) test for `<label>` containing both an actionable and a `hidden` `<input>`
- expand the test for disabled checkbox to also explicitly test starting conditions (used mainly in my debugging)
- ensure that `$btn[0].click()` is used to click checkboxes in tests, rather than the `click()` on the jquery object which is simply a shorthand for `trigger('click')` and does not actually trigger the browser default behavior
- remove the `preventDefault()` from the button handling, which was preventing correct keyboard functionality for checkboxes/radio buttons
- add extra logic to the button.js code to handle checkboxes correctly and avoid double-triggering as a result of mouse interactions (which saw the checkboxes being toggled twice, thus returning them to their original state)
- add logic that prevents the `checked` property from being added incorrectly for any inputs other than radio buttons and checkboxes
- added more tests (including the most basic test for a properly triggered fake checkbox button)
- work around Firefox bug #1540995 (which this code was hitting after removing the `preventDefault()`, due to Firefox's incorrect toggling of disabled checkboxes when programmatically (but not manually) activated with a `click()` event
2019-06-18 15:02:58 +03:00
..
.eslintrc.json avoid console call in our unit tests (#27790) 2018-12-06 10:51:35 +02:00
alert.js chore(deps): update qunit and karma-qunit 2018-05-22 17:26:21 +03:00
button.js Fix keyboard handling of button-style checkbox/radio button groups (#28834) 2019-06-18 15:02:58 +03:00
carousel.js Reset carousel touch delta x to prevent click transformation in swipe (#28558) 2019-03-27 20:57:28 +02:00
collapse.js collapse children with no data-parent 2018-09-10 21:10:00 +02:00
dropdown.js Move dropdown offset function logic into private function. (#28138) 2019-02-05 10:31:18 +02:00
modal.js fix unit tests for chrome mobile 2019-04-29 17:41:28 +03:00
popover.js chore(deps): update qunit and karma-qunit 2018-05-22 17:26:21 +03:00
scrollspy.js fix unit tests for chrome mobile 2019-04-29 17:41:28 +03:00
tab.js fix tabs, apply show class only when fade class is present (#28183) 2019-02-06 11:12:02 +01:00
toast.js Backport #28777. 2019-05-30 11:58:34 +03:00
tooltip.js Add sanitize template option for tooltip/popover plugins. 2019-02-13 08:32:15 +02:00
util.js fix jquery detection 2019-03-08 00:30:24 +02:00