Duplicate selected values after multiple re-setting choices
See original GitHub issueHi, thank you for the cool widget!
found a bug:
setChoices
with replaceChoices = true and preselected choice in the data leads to nonsense duplicated value:
<select multiple></select>
const element = document.querySelector('select');
const choices = new Choices(element);
choices.setChoices([
{label:'Choice 1', value:'1'},
{label:'Choice 2', value:'2', selected:true},
{label:'Choice 3', value:'3'},
], undefined, undefined, true);
choices.setChoices([
{label:'Choice 1', value:'1'},
{label:'Choice 2', value:'2', selected:true},
{label:'Choice 3', value:'3'},
], undefined, undefined, true);
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
jquery - How to Remove duplicate dropdown option elements ...
This works when you start selecting options from scratch, but when form already has fields that are pre-selected (edit_form) the disabling doesn ...
Read more >Automatically Remove Duplicates from Drop Down Lists
To link a data validation list you can set the list to $E$2[Hash Tag ... i could go to data remove duplicates make...
Read more >Cannot select multiple objects in AutoCAD
To enable multiple selections by clicking them with the mouse: On the command line in AutoCAD, enter the PICKADD command. Enter 2 for...
Read more >Duplicate and copy photos and videos on iPhone
Duplicate multiple photos or videos · Tap Library, then tap All Photos or Days. · Tap Select, then tap the thumbnails you want...
Read more >13.2.7.2 INSERT ... ON DUPLICATE KEY UPDATE Statement
INSERT INTO t1 SELECT c, c+d FROM t2 ON DUPLICATE KEY UPDATE b = VALUES(b);. You can eliminate such warnings by using a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can use .clearStore() as temporary solution
Hey - looks like the selected choice isn’t being cleared. Thanks for raising