0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00
Commit Graph

92 Commits

Author SHA1 Message Date
Johann-S
69de65180f Fix unit tests + Update Popper to 1.6.0 2017-05-14 11:41:19 +02:00
Johann-S
c21a2b0d92 Remove constraints option and check every options 2017-05-14 11:41:19 +02:00
Johann-S
54a8ab4011 Begin to use Popper for Dropdown 2017-05-14 11:41:19 +02:00
Patrick H. Lauke
1f37c536b2 Tweak iOS hack for dropdown
Tweak to https://github.com/twbs/bootstrap/pull/22426, where the wrong selector slipped through the net (selecting all of `<body>`s grand-children rather than children)
2017-04-20 14:08:40 +01:00
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
Pierre Vanduynslager
2f94166276 Merge branch 'v4-dev' into dropdown-keyboard 2017-04-12 16:31:50 -04:00
Patrick H. Lauke
3275ca4b30 Reword "mobile" to "touch-enabled"
...as touch is not exclusive to "mobile" anymore nowadays. also explicitly clarifies this is a fix for iOS, and that it impacts touch laptops etc as well. lastly, renames the variable from "dropdown" to "backdrop" for clarity/consistency
2017-04-12 18:39:23 +01:00
Pierre-Denis Vanduynslager
81e12d5715 Indent 2017-04-12 09:41:27 -04:00
Pierre Vanduynslager
fe72daf2b3 Merge branch 'v4-dev' into dropdown-keyboard 2017-04-08 18:43:25 -04:00
Pierre Vanduynslager
f2f8051285 Fix backdrop for dropdown menu on mobile (#21578)
- Create backdrop only if the menu is actually open (do not create it if the show event is prevented)
- Drop the backdrop only when the corresponding menu is closed (do not remove if there is no menu to close or if the hide event is prevented)
2017-03-18 17:41:13 -07:00
Pierre-Denis Vanduynslager
4ab576a419 Fixes #21941 2017-02-08 18:51:50 -05:00
Pierre-Denis Vanduynslager
403f55fba9 Fix spacebar key in Firefox for button elements 2017-01-22 17:34:54 -05:00
Pierre-Denis Vanduynslager
a85b80fa75 Merge branch 'twbs/v4-dev' into dropdown-keyboard 2017-01-15 10:33:54 -05:00
Pierre-Denis Vanduynslager
c80e13a48a Use existing keycode constants in dropdown. (#21697) 2017-01-15 13:42:24 +11:00
Pierre-Denis Vanduynslager
4c2f544359 Merge branch 'twbs/v4-dev' into dropdown-keyboard 2017-01-06 15:57:15 -05:00
Mark Otto
045888fa38 version bump 2017-01-06 08:38:04 -08:00
Pierre-Denis Vanduynslager
67958f35e8 Merge conflict 2017-01-04 12:24:33 -05:00
Pierre-Denis Vanduynslager
c4867cfedb Merge branch 'twbs/v4-dev' into dropdown-keyboard
# Conflicts:
#	js/src/dropdown.js
2017-01-04 12:22:06 -05:00
Pierre-Denis Vanduynslager
bbb0d2b573 Dropdown: close menu when focusing outside element (#21375)
* Close dropdown menu when focusing an outside element
* Update unit test to new markup
2017-01-02 14:44:27 -08:00
Pierre-Denis Vanduynslager
425d156df2 Merge branch 'twbs/v4-dev' into dropdown-keyboard 2016-12-28 19:57:38 -05:00
Starsam80
bf39bb3ac3
Rename .active to .show 2016-12-07 21:20:15 -07:00
Mark Otto
b110070dcd Follow up fix to #19953 for linting error in builds
See https://travis-ci.org/twbs/bootstrap/jobs/179010884 for build failure
2016-11-26 01:04:02 -08:00
Pierre-Denis Vanduynslager
3606c5b9c5 Dropdown perf - on keyboard nav, find active item in the active dropdown rather than the whole document (#19953) 2016-11-26 00:35:49 -08:00
Bardi Harborow
c2616fb74e Make JS compliant with the new ESLint rules. 2016-11-24 11:59:55 +11:00
Johann-S
9d129a43d6 Use a single class name for opened/expanded/shown state of widgets 2016-10-25 14:07:41 +02:00
Mark Otto
8ff7edaab4 version bump to alpha 5 2016-10-19 08:27:41 -07:00
Mark Otto
5495a4b3d3 versions 2016-09-05 12:41:44 -07:00
Mark Otto
24e992a6ff bump versions 2016-07-27 09:31:24 -07:00
Chris Rebert
5a35ad6d74 Use named constants for magic numbers (#19992)
Mostly KeyboardEvent.which and MouseEvent.which values.

[skip validator]
2016-05-30 23:42:00 -07:00
Pierre-Denis Vanduynslager
ab2fc63d08 Dropdown: remove dependency to role="menu", role="listbox" a and li elements => fix keyboard navigation 2016-05-22 02:16:27 -04:00
Chris Rebert
74f1d3b9b8 Merge pull request #18393 from twbs/dropdown-bitwise-less-tricksy
dropdown.js: Use more straightforward phrasing for index bound check
2015-12-24 08:16:19 -07:00
Chris Rebert
31d4139a74 Update version numbers using npm script
Errata from:
* 8ce5da3026
* 5d3144e8fb
which missed a few numbers.

[skip sauce]
[skip validator]
2015-12-08 18:16:47 -08:00
Mark Otto
5d3144e8fb manually bump versions because npm script wasn't working for me 2015-12-08 09:36:08 -08:00
Chris Rebert
75c39f9138 Fix version numbers is JS files; fixes #18435
[skip sauce]
[skip validator]
2015-12-05 02:19:46 -08:00
XhmikosR
79a4273891 Tweak ESLint rules. 2015-12-03 08:41:46 +02:00
Chris Rebert
31ca64232d dropdown.js: Use more straightforward phrasing for index lower bound check
[skip sauce]
[skip validator]
2015-11-30 23:59:39 -08:00
Johann-S
21a65f181e Add throw error for undefined method on plugins 2015-10-02 10:01:24 +02:00
Jacob Thornton
18ff57a183 js tests passing + eslint 2015-08-18 19:22:46 -07:00
Jacob Thornton
05c7a37507 fix dropdown test 2015-08-15 12:17:13 -07:00
fat
f8b2569ec8 implement global dispose method 2015-05-13 12:48:34 -07:00
fat
ca9c850ebb add getters for Version and Default where applicable
add modal my gawd
2015-05-10 19:45:38 -07:00
fat
bbb97a8660 add dropdown 2015-05-10 13:47:11 -07:00