0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Commit Graph

36 Commits

Author SHA1 Message Date
GeoSot
6e1c9096f0
Move get element functionality to a helper (#33327)
Looking around on js components I found out many checks, different expressed but with same purpose.
Some of them are trying to parse string to element, others, jQuery element to js simple nodeElement etc

With this Pr, I am trying to give a standard way to parse an element

So this pr:

* Creates `getElement` helper that tries to parse an argument to element or null
* Changes `isElement` to make  explicit checks and return Boolean 
* fixes tests deficiencies
2021-05-13 18:17:20 +03:00
GeoSot
d794e8970b
Fix test warning for dropdown, without expectations (#33938)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 12:54:51 +03:00
alpadev
7647b8fe5b
Fix: Click on input outside of dropdown-menu prevents dropdown from closing (#33920)
* test: add test if user clicks on input not contained within dropdown-menu

* fix: click on inputs that are not contained within dropdown-menu prevent dropdown from closing
2021-05-11 09:09:00 +03:00
Ben Lertlumprasertkul
052def4568
Remove potential false positive assertions (#33288)
* Remove potential false positive assertions

querySelector() returns null but

expect(document.querySelector('...')).toBeDefined()

tests that the value is not undefined

* Migrated assertions from .toBeDefined() to .not.toBeNull() for .getInstance() calls in tests

* Migrate offcanvas assertions from .toBeDefined() to .not.toBeNull() for .getInstance() call

* convert more cases to not.toBeNull assertions

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-05-11 08:45:57 +03:00
alpadev
e2294ff090
Add missing test for clicking select option in a dropdown (#33734) 2021-04-25 06:45:08 +03:00
Rohit Sharma
b59b75bc55
Dropdown — Add option to make the dropdown menu clickable (#33389) 2021-04-20 08:19:57 +03:00
Rohit Sharma
bac0b0c899 Update tests to check for noop to be removed 2021-04-11 09:42:52 +03:00
Rohit Sharma
20cfbdff79
Add missing things in hide method of dropdown (#33451)
* Update `aria-expanded` attribute in `hide` method

* Remove empty mouseover listeners added for iOS
2021-04-01 21:51:55 +03:00
alpadev
f36f834453
Fix dropdown escape propagation (#33479) 2021-04-01 21:44:04 +03:00
Casey Holzer
16bc47da3c Allow data-toggle="dropdown" and form click events to bubble
* remove stopPropagation from button click event

* test for delegated click events

* ensure button children can open menu

* test to ensure clicking button opens the menu

* check current element and parents

* allow dropdown form click events to bubble
2021-03-23 15:56:28 +02:00
Rohit Sharma
72ef1dfdbd
Update unit tests for Popper V2 (#32662) 2021-03-17 21:25:57 +02:00
Rohit Sharma
dc5e3328c1
Allow constructors to accept a CSS selector (#32245)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <otto@github.com>
2021-02-22 09:01:04 +02:00
GeoSot
3602828a90
Add tests for DATA_KEY (#33090)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-16 08:58:08 +02:00
Kyle Tsang
02dbd87ffa
Fix event handler removal in dropdown/carousel dispose (#33000)
* Fix event handler removal in carousel dispose

* Fix event handler removal in dropdown dispose

* Test event handlers in scrollspy dispose

* Test event handlers in toast dispose

* Test event handlers in tooltip dispose

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-12 07:51:34 +02:00
Rohit Sharma
f7088e5d28
Add function type for popperConfig option (#32882)
* Add function type for `popperConfig` option

* Update .bundlewatch.config.json

* copy edits

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2021-02-09 21:16:13 +02:00
Mark Otto
8f1c882545 Remove .dropdown-menu[style] reset and adjust .dropdown-menu-* modifiers
- Removes the &[style] selector that was used for resetting Popper styles
- Separate Popper-based alignment from static alignment with `data-bs-popover` attribute that separates the --bs-position and custom right/left properties

Co-Authored-By: Rohit Sharma <rohit2sharma95@gmail.com>
2021-02-09 14:34:27 +02:00
Siju Samson
b376a3d80d
Fix dropdown keys to open menu (#32750)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 22:03:21 +02:00
Rohit Sharma
3770b7b9e3
Dropdown — Emit events on the .dropdown-toggle button (#32625)
* Emit events on the dropdown button

Emit the events on `.dropdown-toggle` button and then bubble up

* Add migration note for events

* Update the docs for events

* Add unit test to check the event bubbling

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-03 21:51:19 +02:00
joke2k
881f43a3b9 Restore offset option for dropdown component 2021-01-28 12:23:33 +02:00
Rohit Sharma
c9cd741aff
Throw a TypeError instead of the generic Error (#32585)
* Change from Error to TypeError

* Convert the `NAME` to upper case to make the consistency in the error message

* Update the remaining tests to be stricter

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-01-13 22:13:30 +02:00
Nils K
2d46e47464
Support Popper virtual elements (#32376)
Adds the ability to use objects implementing the virtual element interface as the value for the reference option of a dropdown config.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2020-12-21 14:32:11 +02:00
Johann-S
adfdf7160b Update to popper.js v2.x 2020-12-06 18:42:40 +02:00
Gaël Poupard
9488978fb5 feat(RTL): implement RTL
Using RTLCSS directives, renaming things to use logical names and following best practices.
2020-12-04 07:52:03 +02:00
XhmikosR
51a208f119 Switch to Jasmine's toBeInstanceOf matcher 2020-11-29 20:58:26 +02:00
Johann-S
9f6b342dc7 create a base component 2020-11-29 20:58:26 +02:00
XhmikosR
f4457bca02
Be consistent with Popper's name. (#32224)
The npm package is named "popper.js" but the project is named "Popper", so use the latter consistently.
2020-11-21 16:22:08 +02:00
Rohit Sharma
418f17ee2b Add bs in data attributes
- Add `bs` in data APIs everywhere
- Update unit tests
2020-11-14 07:09:15 +02:00
XhmikosR
c9f8fa45fb
tests: tweak Jasmine usage (#32046)
* jasmine/expect-matcher
* jasmine/prefer-jasmine-matcher

Found with `eslint-plugin-jasmine`
2020-11-02 16:13:24 +02:00
XhmikosR
967e6071ba
tests: streamline HTML end tags (#30648) 2020-05-06 09:20:08 +03:00
Tanguy Krotoff
d2ed920b15
Remove caret element (#30633) 2020-04-24 21:53:31 +02:00
Tanguy Krotoff
7787f642b9 Fix crash when pressing ArrowUp the first time 2020-04-17 18:22:15 +03:00
Tanguy Krotoff
dcd99aa7d1 Replace event.which with event.key and event.button 2020-04-17 18:22:15 +03:00
Martijn Cuppens
2e150e722a Use next dropdown menu instead of first of the parent 2020-03-23 15:35:07 +01:00
Martijn Cuppens
ef6c13c534
tests: Remove button hrefs (#30119) 2020-02-01 20:39:18 +02:00
Jeremy Jackson
c1ee395f80 Skip hidden dropdowns while focusing (#29523) 2019-10-17 18:01:44 +03:00
XhmikosR
577bf8b14d
Rename "js/tests/units" to "js/tests/unit". (#29503) 2019-10-09 01:27:43 +03:00