mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-22 07:26:39 +02:00
fix disabling select boxes if addItems false, document corrects scopes in interface
This commit is contained in:
parent
21a6e22711
commit
2c57d3a690
|
@ -347,9 +347,10 @@ class Choices implements Choices {
|
||||||
this._render();
|
this._render();
|
||||||
this._addEventListeners();
|
this._addEventListeners();
|
||||||
|
|
||||||
const shouldDisable =
|
let shouldDisable = this.passedElement.element.hasAttribute('disabled');
|
||||||
!this.config.addItems ||
|
if (this._isTextElement) {
|
||||||
this.passedElement.element.hasAttribute('disabled');
|
shouldDisable = shouldDisable || !this.config.addItems;
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldDisable) {
|
if (shouldDisable) {
|
||||||
this.disable();
|
this.disable();
|
||||||
|
|
|
@ -105,7 +105,7 @@ export interface Options {
|
||||||
/**
|
/**
|
||||||
* Whether a user can add items.
|
* Whether a user can add items.
|
||||||
*
|
*
|
||||||
* **Input types affected:** text
|
* **Input types affected:** text, select, select-multiple
|
||||||
*
|
*
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue