mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-02 05:52:46 +02:00
Make it work in Internet Explorer (#434)
+ IE does not support multiple-parameter classList.add() / classList.remove(); Replace it with single-parameter calls https://caniuse.com/#feat=classlist + IE needs polyfills for Array.prototype.find / Array.prototype.includes
This commit is contained in:
parent
15082ccd03
commit
8149db8436
|
@ -17,10 +17,8 @@ export default class WrappedElement {
|
|||
|
||||
conceal() {
|
||||
// Hide passed input
|
||||
this.element.classList.add(
|
||||
this.classNames.input,
|
||||
this.classNames.hiddenState,
|
||||
);
|
||||
this.element.classList.add(this.classNames.input);
|
||||
this.element.classList.add(this.classNames.hiddenState);
|
||||
|
||||
// Remove element from tab index
|
||||
this.element.tabIndex = '-1';
|
||||
|
@ -38,10 +36,8 @@ export default class WrappedElement {
|
|||
|
||||
reveal() {
|
||||
// Reinstate passed element
|
||||
this.element.classList.remove(
|
||||
this.classNames.input,
|
||||
this.classNames.hiddenState,
|
||||
);
|
||||
this.element.classList.remove(this.classNames.input);
|
||||
this.element.classList.remove(this.classNames.hiddenState);
|
||||
this.element.removeAttribute('tabindex');
|
||||
|
||||
// Recover original styles if any
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
import 'core-js/fn/array/find';
|
||||
import 'core-js/fn/array/from';
|
||||
import 'core-js/fn/array/includes';
|
||||
import 'custom-event-polyfill';
|
||||
|
|
Loading…
Reference in a new issue