aboutsummaryrefslogtreecommitdiff
path: root/js/src/dropdown.js
AgeCommit message (Collapse)AuthorFilesLines
2021-09-07Release v5.1.1 (#34869)v5.1.1XhmikosR1-1/+1
* Prepare v5.1.1. * Dist
2021-08-04Prepare v5.1.0. (#34674)v5.1.0XhmikosR1-1/+1
2021-07-22make `dataApiKeydownHandler` to handle specific instance, avoiding extra ↵GeoSot1-5/+5
manipulations
2021-07-22extract createPopper methodGeoSot1-23/+27
2021-07-22handle click event in one place, remove undocumented click listener on ↵GeoSot1-11/+1
element in case of not having the proper markup
2021-07-22use classList `add` instead of `toggle` on showGeoSot1-2/+2
2021-07-22simplify toggleGeoSot1-12/+1
2021-07-22Merge `dropdownInterface` to `jQueryInterface`GeoSot1-10/+8
2021-07-22Add `isShown` method and reuse itGeoSot1-6/+10
2021-06-22Release v5.0.2 (#34276)v5.0.2XhmikosR1-1/+1
* Bump version to v5.0.2. * Dist
2021-06-03Add `getOrCreateInstance` method in base-component (#33276)GeoSot1-8/+2
Co-authored-by: Rohit Sharma <[email protected]> Co-authored-by: XhmikosR <[email protected]>
2021-05-22Automatically select an item in the dropdown when using arrow keys (#34052)alpadev1-11/+10
2021-05-19Add `getNextActiveElement` helper function to utils, replacing custom ↵GeoSot1-16/+6
implementation through components (#33608)
2021-05-13Release v5.0.1 (#33972)v5.0.1XhmikosR1-1/+1
* Bump version to 5.0.1. * Dist
2021-05-13Move get element functionality to a helper (#33327)GeoSot1-6/+2
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-11Extract static `DATA_KEY` & `EVENT_KEY` to base-component (#33635)GeoSot1-3/+3
* Force each plugin that extends base-components to implement a static method `NAME()` * Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
2021-05-11Fix: Click on input outside of dropdown-menu prevents dropdown from closing ↵alpadev1-10/+4
(#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-11Refactor: move disposing properties into the base class (#33740)GeoSot1-3/+0
Moves more functionality to `base-component`, transferring the responsibility of disposal to parent class. Each component, dusting disposal, sets its protected properties to `null`. So the same can be done in one place for all children components .
2021-05-05Release v5.0.0 (#33647)v5.0.0XhmikosR1-1/+1
* Bump version to 5.0.0 * Fix npm tag * Dist
2021-04-20Dropdown — Add option to make the dropdown menu clickable (#33389)Rohit Sharma1-7/+13
2021-04-18fix: clicking an item in navbar dropdown collapses the dropdown in firefox ↵alpadev1-1/+1
(#33643)
2021-04-18Change `toggle` method to `remove`Rohit Sharma1-2/+2
Since the class `.show` must be removed
2021-04-18Use context propertiesRohit Sharma1-4/+3
2021-04-18Refactor dropdown's hide functionalityRohit Sharma1-50/+33
2021-04-11refactor: make static `selectMenuItem` method private (#33589)alpadev1-26/+26
2021-04-11Remove element event listeners through base component (#33429)GeoSot1-1/+0
After some research, I found out that EventHandler saves all the custom events per element using namespace, and is capable of removing handlers using only the element and its namespace (`DATA_KEY`). So, probably is better to utilize the base-component to do the same job.
2021-04-11Dropdown — Don't use event delegationRohit Sharma1-3/+3
2021-04-11Use cached `noop` function everywhereRohit Sharma1-3/+3
2021-04-01Add missing things in `hide` method of dropdown (#33451)Rohit Sharma1-2/+9
* Update `aria-expanded` attribute in `hide` method * Remove empty mouseover listeners added for iOS
2021-04-01Fix dropdown escape propagation (#33479)alpadev1-28/+35
2021-03-30Use our `isDisabled` util on dropdown (#33456)GeoSot1-5/+5
2021-03-23Release v5.0.0-beta3 (#33439)v5.0.0-beta3XhmikosR1-1/+1
2021-03-23Allow data-toggle="dropdown" and form click events to bubbleCasey Holzer1-12/+19
* 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-02Dropdown — Drop `flip` option (#33198)Rohit Sharma1-3/+0
2021-03-02refactor: use a Map instead of an Object in dom/data (#32180)alpadev1-2/+2
Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Rohit Sharma <[email protected]>
2021-02-16util: change `isRTL` to a function (#32446)XhmikosR1-6/+6
This allows the bundler to tree-shake the function.
2021-02-12Fix event handler removal in dropdown/carousel dispose (#33000)Kyle Tsang1-1/+2
* 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 <[email protected]> Co-authored-by: Rohit Sharma <[email protected]>
2021-02-10Release v5.0.0-beta2 (#32467)v5.0.0-beta2XhmikosR1-1/+1
* Bump version to 5.0.0-beta2 * Dist
2021-02-09Add function type for `popperConfig` option (#32882)Rohit Sharma1-5/+5
* Add function type for `popperConfig` option * Update .bundlewatch.config.json * copy edits Co-authored-by: XhmikosR <[email protected]> Co-authored-by: Mark Otto <[email protected]>
2021-02-09Dropdown — Change the selector to check the use of Popper (#33003)Rohit Sharma1-2/+2
* Create the popper instance first Make sure that popper instance has been created first and then apply the styling on the dropdown(menu) * Use `data-bs-popper` attibute to check popper Co-authored-by: XhmikosR <[email protected]>
2021-02-09Remove .dropdown-menu[style] reset and adjust .dropdown-menu-* modifiersMark Otto1-2/+13
- 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 <[email protected]>
2021-02-09Remove custom `fallbackPlacements` from dropdown (#32843)Rohit Sharma1-6/+0
2021-02-04Fix Popper preventOverflow boundary config (#32845)Kyle Tsang1-1/+1
Currently, the boundary config is being assigned to the wrong var (`rootBoundary`) in the popper config. It should be assigned to the `boundary` var in popper's config. Ref: https://popper.js.org/docs/v2/utils/detect-overflow/#boundary
2021-02-03Fix dropdown keys to open menu (#32750)Siju Samson1-0/+6
Co-authored-by: XhmikosR <[email protected]>
2021-02-03Dropdown — Emit events on the `.dropdown-toggle` button (#32625)Rohit Sharma1-7/+5
* 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 <[email protected]>
2021-02-03Remove the initial margin from dropdown/popover in favor of Popper (#32524)Rohit Sharma1-1/+1
* Remove the margin from dropdown in favor of Popper - Set the default margin to 0 for dropdowns (To remove the Popper's warning) - Set the required offset in dropdown's defaults * Remove the margin from the popover component Co-authored-by: XhmikosR <[email protected]>
2021-01-28Restore offset option for dropdown componentjoke2k1-2/+22
2021-01-13Throw a `TypeError` instead of the generic `Error` (#32585)Rohit Sharma1-1/+1
* 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 <[email protected]>
2020-12-21Support Popper virtual elements (#32376)Nils K1-1/+10
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 <[email protected]>
2020-12-09Add fallback behaviourMartijn Cuppens1-0/+6