Skip to content

[Combobox] Clear or Clear group missing #1268

Discussion options

You must be logged in to vote

Good point. We could add this to the ListboxMixin (that is the parent of the Combobox, SelectRich and Listbox).

It should have a clear method, since it is more like a Field than a FormGroup (think of native <select>, the options are not individual submittable elements).
We might want to let the Listbox fully depend on LionField in the future and then we would get this api for free.

For now, the quickest way of achieving this would be to add this to ListboxMixin:

clear() {
  this.setCheckedIndex(-1);
}

For LionCombobox:

clear() {
   super.clear();
   this._inputNode.value = '';
}

If you want, you could do a merge request for this.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tlouisse
Comment options

Answer selected by tlouisse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1227 on March 16, 2021 10:50.