This adds a hw-combobox:selection custom event, the details of which describe the status of the combobox.
This also introduces a new feature where if the combobox value is unjustifiably blank (i.e. no blank option is selected but the value is empty), then we clear the query. In line with https://github.com/josefarias/hotwire_combobox/discussions/70, and also aligns well with the ergonomics of being able to expect an hw-combobox:selection event every time the hidden field value changes.
Finally, this also fixes a bug in the memoization of canonical_id, adds the missing .hw-combobox__input--invalid CSS class, and more completely adjusts validity in all comboboxes.
This adds a hw-combobox:selection custom event, the details of which describe the status of the combobox.
This also introduces a new feature where if the combobox value is unjustifiably blank (i.e. no blank option is selected but the value is empty), then we clear the query. In line with https://github.com/josefarias/hotwire_combobox/discussions/70, and also aligns well with the ergonomics of being able to expect an hw-combobox:selection event every time the hidden field value changes.
Finally, this also fixes a bug in the memoization of canonical_id, adds the missing
.hw-combobox__input--invalid
CSS class, and more completely adjusts validity in all comboboxes.