fix disabling select boxes if addItems false, document corrects scopes in interface

This commit is contained in:
alex 2020-04-16 04:58:57 +02:00
parent 21a6e22711
commit 2c57d3a690
2 changed files with 5 additions and 4 deletions

View file

@ -347,9 +347,10 @@ class Choices implements Choices {
this._render();
this._addEventListeners();
const shouldDisable =
!this.config.addItems ||
this.passedElement.element.hasAttribute('disabled');
let shouldDisable = this.passedElement.element.hasAttribute('disabled');
if (this._isTextElement) {
shouldDisable = shouldDisable || !this.config.addItems;
}
if (shouldDisable) {
this.disable();

View file

@ -105,7 +105,7 @@ export interface Options {
/**
* Whether a user can add items.
*
* **Input types affected:** text
* **Input types affected:** text, select, select-multiple
*
* @default true
*/