mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
* Fixes #188 - update value after setRangeText call * Apply setRangeText fix to textarea * Update setRangeFix to check for changed value
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user