Open
Description
I did:
- Search for if my issue has already been submitted
- Make sure I'm reporting something precise that needs to be fixed
- Give my issue a descriptive and concise title
- Create a minimal working example on JsFiddle or Codepen
(or gave a link to a demo on the Selectize docs) - Indicate precise steps to reproduce in numbers and the result,
like below
[replace me with a short description of issue]
Steps to reproduce:
- Go to https://selectize.dev/docs/demos/api
- Make a selection, e.g. "Star Chart"
- Click the
clearOptions()
button
Expected result:
EITHER:
- The behavior described by the current API docs:
- The current selection is cleared
- All options are removed
- (This was the behavior of selectize.js < v0.12.5)
OR:
- The behavior described by the changelog:
- Any non-selected options are removed
- The current selection remains selected
- This was requested by clearOptions should not clear items #593 and How to dynamically update options on type #1079 and implemented by f6c4f7c; it was the behavior of selectize.js ≥ v0.12.5, < v0.13.1
Actual result:
- Only non-selected items are removed from the options
- Any current selections are cleared, but remain as options
Cause:
#1553 (released in v0.13.1) added back the self.clear()
to the end of the clearOptions
code, but did not remove the logic change that prevents currently-selected items from being removed from the list of options. This PR was intended to close #832 , but that request only made sense before the behavior of clearOptions()
was changed (in v0.12.5) to not affect the current selection. I suspect that this oversight was due to v0.12.5 not updating the docs to clarify that selected items were intended to be kept--the newer PR also updated the docs to imply that the pre-0.12.5 behavior was intended.
Metadata
Metadata
Assignees
Labels
No labels