mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-17 21:16:34 +02:00
Added the listeners added in this.containerOuter.element to allow shadow dom active.
This commit is contained in:
parent
d2a80fcb12
commit
7ffd9bb471
|
@ -2571,16 +2571,15 @@ function () {
|
|||
};
|
||||
|
||||
Choices.prototype._addEventListeners = function () {
|
||||
var documentElement = document.documentElement; // capture events - can cancel event processing or propagation
|
||||
|
||||
documentElement.addEventListener('touchend', this._onTouchEnd, true);
|
||||
// capture events - can cancel event processing or propagation
|
||||
this.containerOuter.element.addEventListener('touchend', this._onTouchEnd, true);
|
||||
this.containerOuter.element.addEventListener('keydown', this._onKeyDown, true);
|
||||
this.containerOuter.element.addEventListener('mousedown', this._onMouseDown, true); // passive events - doesn't call `preventDefault` or `stopPropagation`
|
||||
|
||||
documentElement.addEventListener('click', this._onClick, {
|
||||
this.containerOuter.element.addEventListener('click', this._onClick, {
|
||||
passive: true
|
||||
});
|
||||
documentElement.addEventListener('touchmove', this._onTouchMove, {
|
||||
this.containerOuter.element.addEventListener('touchmove', this._onTouchMove, {
|
||||
passive: true
|
||||
});
|
||||
this.dropdown.element.addEventListener('mouseover', this._onMouseOver, {
|
||||
|
|
2
public/assets/scripts/choices.min.js
vendored
2
public/assets/scripts/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1308,10 +1308,12 @@ class Choices {
|
|||
}
|
||||
|
||||
_addEventListeners(): void {
|
||||
const { documentElement } = document;
|
||||
|
||||
// capture events - can cancel event processing or propagation
|
||||
documentElement.addEventListener('touchend', this._onTouchEnd, true);
|
||||
this.containerOuter.element.addEventListener(
|
||||
'touchend',
|
||||
this._onTouchEnd,
|
||||
true,
|
||||
);
|
||||
this.containerOuter.element.addEventListener(
|
||||
'keydown',
|
||||
this._onKeyDown,
|
||||
|
@ -1324,10 +1326,16 @@ class Choices {
|
|||
);
|
||||
|
||||
// passive events - doesn't call `preventDefault` or `stopPropagation`
|
||||
documentElement.addEventListener('click', this._onClick, { passive: true });
|
||||
documentElement.addEventListener('touchmove', this._onTouchMove, {
|
||||
this.containerOuter.element.addEventListener('click', this._onClick, {
|
||||
passive: true,
|
||||
});
|
||||
this.containerOuter.element.addEventListener(
|
||||
'touchmove',
|
||||
this._onTouchMove,
|
||||
{
|
||||
passive: true,
|
||||
},
|
||||
);
|
||||
this.dropdown.element.addEventListener('mouseover', this._onMouseOver, {
|
||||
passive: true,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue