* test: add more test cases for Manipulator.offset()
* fix: Manipulator.offset() is using obsolete properties to get scroll position
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: GeoSot <geo.sotis@gmail.com>
* consolidate dialog focus trap logic
* add shift-tab support to focustrap
* remove redundant null check of trap element
Co-authored-by: GeoSot <geo.sotis@gmail.com>
* remove area support forom focusableChildren
* fix no expectations warning in focustrap tests
Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
* change data-dismiss, so can be outside modal, using a bs-target
* Update site/content/docs/5.0/components/modal.md
Co-authored-by: Gaël Poupard <ffoodd@users.noreply.github.com>
Alert.js: Refactor code to match the other components
* Use this._element
* Remove handleDismiss method and keep its functionality on event
* Change JqueryInterface to be more generic
* Correct docs to be aligned with code, and add undocumented functionality
* Update alerts.md
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
* refactor: reuse one DOMContentLoaded event listener in onDOMContentLoaded function
Instead of adding an event listener everytime the utility function is called, cache the callbacks and execute them all at once.
* refactor: drop iife for onDOMContentLoaded
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
* test(carousel): add test to check if next/prev button work as intended
* fix(carousel): merge passed config with instance config in carouselInterface
Fix handling of transitionend events dispatched by nested elements
Properly handle events from nested elements
Change `emulateTransitionEnd` to `executeAfterTransition` &&
The current config can cause the "body" to become stale. Specifically,
if the entire body element is swapped out for a new body element, then
the backdrop will continue to append itself to the original body element,
since it's stored in memory as a reference on this object.
This also no longer allows an explicit null to be passed to Backdrop's rootElement
This still accomplishes the laziness of "not finding the rootElement
until the Backdrop is created" to avoid problems of the JavaScript
being included inside <head> (so, before body is available).
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
* Force each plugin that extends base-components to implement a static method `NAME()`
* Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
* 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
* 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>
* Initialize default value of rootElement before using
* Remove redundant test | put rootElement tests together
Co-authored-by: GeoSot <geo.sotis@gmail.com>
* test: update spec for sibling adjacent mouseenter/mouseleave events
there is a regression introduced by #33310 - this would have catched that
* fix: fixup regression for mouseenter/mouseleave events introduced by #33310
the old logic only worked for parent-child movement since it checked for the relatedTarget to contain the delegateTarget - this should be fixed with this
Co-authored-by: XhmikosR <xhmikosr@gmail.com>