diff --git a/src/scripts/src/choices.js b/src/scripts/src/choices.js index a34eefb..63f184f 100644 --- a/src/scripts/src/choices.js +++ b/src/scripts/src/choices.js @@ -249,16 +249,18 @@ class Choices { this.currentState.groups !== this.prevState.groups || this.currentState.items !== this.prevState.items ); + const shouldRenderChoices = this.isSelectElement; + const shouldRenderItems = this.currentState.items !== this.prevState.items; if (!stateChanged) { return; } - if (this.isSelectElement) { + if (shouldRenderChoices) { this._renderChoices(); } - if (this.currentState.items !== this.prevState.items) { + if (shouldRenderItems) { this._renderItems(); }