Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autosuggest: when an item is unselected, remove the corresponding HTM…
…L 'option' element (#240) The select2 component that we use to manage the autosuggest controls appends an HTML 'option' element each time an item is selected by the user, if one does not already exist. Also, the select2 component displays user-facing selections by looping over the HTML option elements that it finds in the DOM. So, to ensure that newly-added selections always appear at the end of the user-facing selection list, we need to maintain the same order for the option elements in the DOM. In particular, when a user unselects/clears an item, we need to remove the corresponding HTML option element.
- Loading branch information