kopia lustrzana https://github.com/shoelace-style/shoelace
Refactor clear logic in input
rodzic
6a731ca015
commit
d8fc0464bb
|
@ -4,6 +4,7 @@
|
|||
|
||||
- Added `input`, `label`, `prefix`, `clear-button`, `suffix`, `help-text` exported parts to `sl-select` to make the input customizable
|
||||
- Fixed bug where mouse events would bubble up when `sl-button` was disabled, causing tooltips to erroneously appear
|
||||
- Refactored clear logic in `sl-input`
|
||||
|
||||
## 2.0.0-beta.18
|
||||
|
||||
|
|
|
@ -229,15 +229,13 @@ export class Input {
|
|||
}
|
||||
|
||||
handleClearClick(event: MouseEvent) {
|
||||
if (this.input.value !== '') {
|
||||
this.input.value = '';
|
||||
this.input.dispatchEvent(new window.Event('input', { bubbles: true }));
|
||||
this.input.dispatchEvent(new window.Event('change', { bubbles: true }));
|
||||
}
|
||||
this.value = '';
|
||||
this.slClear.emit();
|
||||
this.slInput.emit();
|
||||
this.slChange.emit();
|
||||
this.input.focus();
|
||||
|
||||
event.stopPropagation();
|
||||
this.slClear.emit();
|
||||
this.input.focus();
|
||||
}
|
||||
|
||||
handleMouseDown(event: MouseEvent) {
|
||||
|
|
Ładowanie…
Reference in New Issue