mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 00:42:15 +02:00
Ability to set item by disabled choice programatically
This commit is contained in:
parent
3d45b1d382
commit
53f7207257
4
assets/scripts/dist/choices.js
vendored
4
assets/scripts/dist/choices.js
vendored
|
@ -1,4 +1,4 @@
|
||||||
/*! choices.js v2.0.4 | (c) 2016 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
/*! choices.js v2.0.5 | (c) 2016 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||||
/******/ (function(modules) { // webpackBootstrap
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
/******/ // The module cache
|
/******/ // The module cache
|
||||||
/******/ var installedModules = {};
|
/******/ var installedModules = {};
|
||||||
|
@ -1915,7 +1915,7 @@
|
||||||
|
|
||||||
this.store.dispatch((0, _index3.addChoice)(value, choiceLabel, choiceId, groupId, isDisabled));
|
this.store.dispatch((0, _index3.addChoice)(value, choiceLabel, choiceId, groupId, isDisabled));
|
||||||
|
|
||||||
if (isSelected && !isDisabled) {
|
if (isSelected) {
|
||||||
this._addItem(value, choiceLabel, choiceId);
|
this._addItem(value, choiceLabel, choiceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
assets/scripts/dist/choices.js.map
vendored
2
assets/scripts/dist/choices.js.map
vendored
File diff suppressed because one or more lines are too long
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
|
@ -1643,7 +1643,7 @@ export default class Choices {
|
||||||
|
|
||||||
this.store.dispatch(addChoice(value, choiceLabel, choiceId, groupId, isDisabled));
|
this.store.dispatch(addChoice(value, choiceLabel, choiceId, groupId, isDisabled));
|
||||||
|
|
||||||
if (isSelected && !isDisabled) {
|
if (isSelected) {
|
||||||
this._addItem(value, choiceLabel, choiceId);
|
this._addItem(value, choiceLabel, choiceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,8 @@
|
||||||
|
|
||||||
<h2>Single select input</h2>
|
<h2>Single select input</h2>
|
||||||
<label for="choices-single-default">Default</label>
|
<label for="choices-single-default">Default</label>
|
||||||
<select class="form-control" data-choice name="choices-single-default" id="choices-single-default" placeholder="This is a placeholder">
|
<select class="form-control" data-choice name="choices-single-default" id="choices-single-default" placeholder="This is a search placeholder">
|
||||||
|
<option selected disabled>This is a placeholder</option>
|
||||||
<option value="Dropdown item 1">Dropdown item 1</option>
|
<option value="Dropdown item 1">Dropdown item 1</option>
|
||||||
<option value="Dropdown item 2">Dropdown item 2</option>
|
<option value="Dropdown item 2">Dropdown item 2</option>
|
||||||
<option value="Dropdown item 3">Dropdown item 3</option>
|
<option value="Dropdown item 3">Dropdown item 3</option>
|
||||||
|
|
Loading…
Reference in a new issue