kopia lustrzana https://github.com/shoelace-style/shoelace
* Fixes #188 - update value after setRangeText call * Apply setRangeText fix to textarea * Update setRangeFix to check for changed valuepull/196/head
rodzic
6b9a07eab8
commit
f0ba06e6ec
|
@ -176,7 +176,15 @@ export class Input {
|
|||
end: number,
|
||||
selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'
|
||||
) {
|
||||
return this.input.setRangeText(replacement, start, end, selectMode);
|
||||
const returnValue = this.input.setRangeText(replacement, start, end, selectMode);
|
||||
|
||||
if (this.value !== this.input.value) {
|
||||
this.value = this.input.value;
|
||||
this.slChange.emit();
|
||||
this.slInput.emit();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
handleChange() {
|
||||
|
|
|
@ -154,7 +154,16 @@ export class Textarea {
|
|||
end: number,
|
||||
selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'
|
||||
) {
|
||||
return this.textarea.setRangeText(replacement, start, end, selectMode);
|
||||
const returnValue = this.textarea.setRangeText(replacement, start, end, selectMode);
|
||||
|
||||
if (this.value !== this.textarea.value) {
|
||||
this.value = this.textarea.value;
|
||||
this.setTextareaHeight();
|
||||
this.slChange.emit();
|
||||
this.slInput.emit();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
handleChange() {
|
||||
|
|
Ładowanie…
Reference in New Issue