mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-18 13:45:12 +02:00
Resolve IE11 bug with documentFragment.children
This commit is contained in:
parent
d099c17f68
commit
f201b6cd09
|
@ -16,7 +16,7 @@
|
|||
"no-underscore-dangle": "off",
|
||||
"no-new": 0,
|
||||
"max-len": "off",
|
||||
"no-console": ["error", { allow: ["warn", "error"] }],
|
||||
"no-console": "off",
|
||||
"consistent-return": "off",
|
||||
"no-param-reassign": ["error", { "props": false }],
|
||||
"no-unused-vars": ["error", { "args": "none" }]
|
||||
|
|
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -10,7 +10,6 @@ import {
|
|||
addGroup,
|
||||
clearAll,
|
||||
} from './actions/index';
|
||||
|
||||
import {
|
||||
isScrolledIntoView,
|
||||
getAdjacentEl,
|
||||
|
@ -1917,7 +1916,6 @@ export default class Choices {
|
|||
items.forEach((item) => {
|
||||
// Create new list element
|
||||
const listItem = this._getTemplate('item', item);
|
||||
|
||||
// Append it to list
|
||||
itemListFragment.appendChild(listItem);
|
||||
});
|
||||
|
@ -1936,7 +1934,7 @@ export default class Choices {
|
|||
// Only render if our state has actually changed
|
||||
if (this.currentState !== this.prevState) {
|
||||
// Choices
|
||||
if ((this.currentState.choices !== this.prevState.choices || this.currentState.groups !== this.prevState.groups)) {
|
||||
if (this.currentState.choices !== this.prevState.choices || this.currentState.groups !== this.prevState.groups) {
|
||||
if (this.passedElement.type === 'select-multiple' || this.passedElement.type === 'select-one') {
|
||||
// Get active groups/choices
|
||||
const activeGroups = this.store.getGroupsFilteredByActive();
|
||||
|
@ -1981,7 +1979,7 @@ export default class Choices {
|
|||
this.itemList.innerHTML = '';
|
||||
|
||||
// If we have items to add
|
||||
if (itemListFragment.children && itemListFragment.children.length) {
|
||||
if (itemListFragment.childNodes) {
|
||||
// Update list
|
||||
this.itemList.appendChild(itemListFragment);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<!-- Ignore these -->
|
||||
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=1.1.2">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,matchMedia,fetch,Element.prototype.placeholder,Array.prototype.includes"></script>
|
||||
<!-- End ignore these -->
|
||||
|
||||
<!-- Choices includes -->
|
||||
|
|
Loading…
Reference in a new issue