This commit is contained in:
Sebastian Zoglowek 2026-02-25 11:49:09 +01:00
commit a5458f18b9
13 changed files with 94 additions and 4 deletions

View file

@ -3487,6 +3487,7 @@
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -4613,6 +4614,9 @@
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -4647,6 +4651,7 @@
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -5040,6 +5045,12 @@
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

File diff suppressed because one or more lines are too long

View file

@ -3481,6 +3481,7 @@ var Choices = /** @class */ (function () {
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -4607,6 +4608,9 @@ var Choices = /** @class */ (function () {
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -4641,6 +4645,7 @@ var Choices = /** @class */ (function () {
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -5034,6 +5039,12 @@ var Choices = /** @class */ (function () {
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

View file

@ -3008,6 +3008,7 @@
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -4134,6 +4135,9 @@
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -4168,6 +4172,7 @@
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -4561,6 +4566,12 @@
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

File diff suppressed because one or more lines are too long

View file

@ -3002,6 +3002,7 @@ var Choices = /** @class */ (function () {
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -4128,6 +4129,9 @@ var Choices = /** @class */ (function () {
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -4162,6 +4166,7 @@ var Choices = /** @class */ (function () {
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -4555,6 +4560,12 @@ var Choices = /** @class */ (function () {
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

View file

@ -1895,6 +1895,7 @@
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -3021,6 +3022,9 @@
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -3055,6 +3059,7 @@
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -3448,6 +3453,12 @@
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

File diff suppressed because one or more lines are too long

View file

@ -1889,6 +1889,7 @@ var Choices = /** @class */ (function () {
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -3015,6 +3016,9 @@ var Choices = /** @class */ (function () {
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -3049,6 +3053,7 @@ var Choices = /** @class */ (function () {
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -3442,6 +3447,12 @@ var Choices = /** @class */ (function () {
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

View file

@ -1853,6 +1853,7 @@
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -2979,6 +2980,9 @@
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -3013,6 +3017,7 @@
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -3406,6 +3411,12 @@
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

File diff suppressed because one or more lines are too long

View file

@ -1847,6 +1847,7 @@ var Choices = /** @class */ (function () {
this._onChange = this._onChange.bind(this);
this._onInvalid = this._onInvalid.bind(this);
this._onWindowResize = this._onWindowResize.bind(this);
this._onScroll = this._onScroll.bind(this);
// If element has already been initialised with Choices, fail silently
if (this.passedElement.isActive) {
if (!config.silent) {
@ -2973,6 +2974,9 @@ var Choices = /** @class */ (function () {
dropdownElement.addEventListener('keydown', this._onKeyDown, true);
dropdownElement.addEventListener('mousedown', this._onMouseDown, true);
window.addEventListener('resize', this._onWindowResize);
window.addEventListener('scroll', this._onScroll, {
passive: true,
});
}
this.input.addEventListeners();
};
@ -3007,6 +3011,7 @@ var Choices = /** @class */ (function () {
dropdownElement.removeEventListener('keydown', this._onKeyDown);
dropdownElement.removeEventListener('mousedown', this._onMouseDown);
window.removeEventListener('resize', this._onWindowResize);
window.removeEventListener('scroll', this._onScroll);
}
this.input.removeEventListeners();
};
@ -3400,6 +3405,12 @@ var Choices = /** @class */ (function () {
this.containerOuter.addInvalidState();
};
Choices.prototype._onWindowResize = function () {
this._moveDropdown();
};
Choices.prototype._onScroll = function () {
this._moveDropdown();
};
Choices.prototype._moveDropdown = function () {
if (!this.dropdown.isActive) {
return;
}

View file

@ -205,6 +205,8 @@ declare class Choices {
}): void;
_onInvalid(): void;
_onWindowResize(): void;
_onScroll(): void;
_moveDropdown(): void;
/**
* Removes any highlighted choice options
*/