Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a removeCurrentItems parameter to clearOptions() to allow for either intended behavior #2147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dvg-p4
Copy link

@dvg-p4 dvg-p4 commented Oct 9, 2024

  • clearOptions() now, by default, removes currently-selected items in addition to deselecting them,
    as it did prior to selectize v0.12.5.
    • This behavior is controlled by a new parameter removeCurrentItems, default true.
    • If removeCurrentItems is set false, the function will instead leave currently-selected items
      available and selected, as was the case from selectize v0.12.5, until v0.13.1 introduced
      #2146 (which this change fixes).
    • For consistency, silent also has a (backwards-compatible) default value of false now.
    • Thus, the full signature is now clearOptions(silent = false, removeCurrentItems = true)

I don't feel very strongly about the new parameter being default true, as long as whatever its default value is, is correctly and comprehensively documented. You could make the argument either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant