Disable element if disabled attr passed

This commit is contained in:
Josh Johnson 2018-10-30 20:21:52 +00:00
commit 3058a3993f
3 changed files with 34 additions and 6 deletions

View file

@ -68,6 +68,15 @@
</select>
</div>
<div data-test-hook="disabled-via-attr">
<label for="choices-disabled-via-attr">Disabled via attribute</label>
<select class="form-control" name="choices-disabled-via-attr" id="choices-disabled-via-attr" multiple disabled>
<option value="Choice 1" selected>Choice 1</option>
<option value="Choice 2">Choice 2</option>
<option value="Choice 3">Choice 3</option>
</select>
</div>
<div data-test-hook="selection-limit">
<label for="choices-selection-limit">Input limit</label>
<select class="form-control" name="choices-selection-limit" id="choices-selection-limit" multiple>
@ -173,6 +182,8 @@
addItems: false,
});
new Choices('#choices-disabled-via-attr');
new Choices('#choices-selection-limit', {
maxItemCount: 5,
});