Skip to content

Commit d617b51

Browse files
committed
Refactor SliderWebcomponent: Directly invoke _handleInputChange in attribute change handlers
- Removed the need to dispatch 'blur' events in attribute change handlers for `valueMin` and `valueMax`. - Directly call `_handleInputChange` method in `_valueMinAttributeChanged` and `_valueMaxAttributeChanged`. - Implemented type casting to properly handle the event target. - Retained suppression of attribute change events to prevent infinite loops.
1 parent 77c8221 commit d617b51

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/slider/SliderWebcomponent.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,12 @@ export class SliderWebcomponent extends BaseCustomWebComponentConstructorAppend
322322

323323
private _valueMinAttributeChanged() {
324324
if (!this._ready) return;
325-
this._numberInputs[0].value = this.valueMin.toString();
326-
this._numberInputs[0].dispatchEvent(new Event('blur', { bubbles: true }));
325+
this._handleInputChange({ target: this._numberInputs[0] } as unknown as Event);
327326
}
328327

329328
private _valueMaxAttributeChanged() {
330329
if (!this._ready) return;
331-
this._numberInputs[1].value = this.valueMax.toString();
332-
this._numberInputs[1].dispatchEvent(new Event('blur', { bubbles: true }));
330+
this._handleInputChange({ target: this._numberInputs[1] } as unknown as Event);
333331
}
334332

335333
private _minAttributeChanged() {

0 commit comments

Comments
 (0)