bootstrap/js/src
Patrick H. Lauke 6d64afe508 Replace dropdown backdrop hack with cleaner JS-only hack
* Replace backdrop with simple noop mouse listener

As discussed in https://github.com/twbs/bootstrap/pull/22422 the current
approach of injecting a backdrop (to work around iOS' broken event
delegation for the `click` event) has annoying consequences on
touch-enabled laptop/desktop devices.
Instead of a backdrop `<div>`, here we simply add extra empty/noop
mouse listeners to the immediate children of `<body>` (and remove
them when the dropdown is closed) in order to force iOS to properly
bubble a `click` resulting from a tap (essentially, method 2 from
https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html)
This is sufficient (except in rare cases where the user does manage to tap
on the body itself, rather than any child elements of body - which is not
very likely in an iOS phone/tablet scenario for most layouts) to get iOS to
get a grip and do the correct event bubbling/delegation, meaning the regular
"click" event will bubble back to the `<body>` when tapping outside of the dropdown,
and the dropdown will close properly (just like it already does, even without
this fix, in non-iOS touchscreen devices/browsers, like Chrome/Android and
Windows on a touch laptop).
This approach, though a bit hacky, has no impact on the DOM structure, and
has no unforeseen side effects on touch-enabled laptops/desktops. And crucially,
it works just fine in iOS.

* Remove dropdown backdrop styles

* Update doc for dropdowns and touch-enabled devices
2017-04-14 09:19:00 +01:00
..
alert.js version bump 2017-01-06 08:38:04 -08:00
button.js Only change aria-pressed if it's not an input-based radio or checkbox group 2017-04-10 14:43:54 +01:00
carousel.js Fix JS components console error "Error: <Component> is transitioning" 2017-03-28 23:43:15 +02:00
collapse.js Fix collapse.js aria-expanded behavior 2017-04-10 14:51:22 +01:00
dropdown.js Replace dropdown backdrop hack with cleaner JS-only hack 2017-04-14 09:19:00 +01:00
modal.js Prevent default for ESC in modal.js 2017-04-09 16:19:20 +01:00
popover.js version bump 2017-01-06 08:38:04 -08:00
scrollspy.js Tabs/Scrollspy/.nav/.list-group/.active independent of markup (<nav>, .nav-item, <li> etc...) 2017-04-02 11:21:04 +02:00
tab.js Tabs/Scrollspy/.nav/.list-group/.active independent of markup (<nav>, .nav-item, <li> etc...) 2017-04-02 11:21:04 +02:00
tooltip.js Popover + Tooltip - fix error when content or title is a number 2017-03-31 10:03:54 +02:00
util.js Fix getSelectorFromElement when # is a selector (#21615) 2017-03-18 17:42:11 -07:00