fix value not clearing with clear / tag removal

This commit is contained in:
konnorrogers
2024-11-04 13:34:43 -05:00
parent 2817c82952
commit bcfbe2bc8a

View File

@@ -464,6 +464,8 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon
private handleClearClick(event: MouseEvent) {
event.stopPropagation();
this.valueHasChanged = true
if (this.value !== '') {
this.setSelectedOptions([]);
this.displayInput.focus({ preventScroll: true });
@@ -535,6 +537,8 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon
private handleTagRemove(event: SlRemoveEvent, option: SlOption) {
event.stopPropagation();
this.valueHasChanged = true
if (!this.disabled) {
this.toggleOptionSelection(option, false);