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
|
- 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
|
- 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
|
## 2.0.0-beta.18
|
||||||
|
|
||||||
|
|
|
@ -229,15 +229,13 @@ export class Input {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClearClick(event: MouseEvent) {
|
handleClearClick(event: MouseEvent) {
|
||||||
if (this.input.value !== '') {
|
this.value = '';
|
||||||
this.input.value = '';
|
this.slClear.emit();
|
||||||
this.input.dispatchEvent(new window.Event('input', { bubbles: true }));
|
this.slInput.emit();
|
||||||
this.input.dispatchEvent(new window.Event('change', { bubbles: true }));
|
this.slChange.emit();
|
||||||
}
|
this.input.focus();
|
||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.slClear.emit();
|
|
||||||
this.input.focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMouseDown(event: MouseEvent) {
|
handleMouseDown(event: MouseEvent) {
|
||||||
|
|
Ładowanie…
Reference in New Issue