* Fix: Popover with hover and click triggers closes on mouseleave
When a popover is configured with `trigger: 'hover click'`,
if you open it by a click, it would incorrectly close when the
mouse pointer leaves the trigger element. This was because the
`mouseleave` event (part of the hover trigger) would hide the
popover without adequately respecting the click trigger's intent
to keep it open.
This commit modifies the click event listener within `Tooltip.js`
(which Popover extends) to explicitly manage the `_activeTrigger[TRIGGER_CLICK]`
state:
- When a click opens the popover or makes a hover-opened popover
sticky, `_activeTrigger[TRIGGER_CLICK]` is set to `true`.
- When a click closes an already click-activated popover,
`_activeTrigger[TRIGGER_CLICK]` is set to `false`.
The `_leave()` method, called by `mouseleave`, already checks
`_isWithActiveTrigger()`. With `_activeTrigger[TRIGGER_CLICK]`
now accurately reflecting the click state, `_leave()` will not
hide a click-activated popover when the mouse leaves the trigger
element. The popover will now correctly remain open until a
subsequent click closes it.
* Removed `test-popover.html`
* Fix linting issues
* Add unit test
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
* From Twitter to X
* .
* Use Bootstrap Icons
* Set X card to use `twitter` again
* Update `tests/unit/popover.spec.js`
---------
Co-authored-by: Julien Déramond <juderamond@gmail.com>
* fix: regression of #38989
* Add unit test in selector-engine.spec.js
---------
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
* Support `Home` and `End` keys in tabs
* Update tab.js
* simplify tests
* Update navs-tabs.md
* Update .bundlewatch.config.json
---------
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
* Bind Hugo to 0.0.0.0, helps debug on mobile when on the same network
* Use http-server for visual tests
* Add input visual tests
* Fix input date dimensions on Android Chrome
* Increase bootstrap.css max size
* Revert "Bind Hugo to 0.0.0.0" & "Use http-server for visual tests"
* Switch to pixels: this is an empirical minimum safe value
* Update .bundlewatch.config.json
Co-authored-by: Mark Otto <otto@github.com>
* Expand dropdown explanation for use of `<a>`, use `<button>`s for modal examples
* Remove redundant `role="button"` from collapse test `<button>` elements
* Tweak language
* Tweak collapse prose
* Move `getElementFromSelector` & getSelectorFromElement` inside selector-engine.js, in order to use SelectorEngine methods, avoiding raw querySelector usage
* add `getMultipleElementsFromSelector` helper
Co-authored-by: Julien Déramond <juderamond@gmail.com>