refactor(core): replace document listeners with pointer capture in slider (#762)

This commit is contained in:
rahim
2026-03-06 13:42:31 -08:00
committed by GitHub
parent 814ba017e4
commit f2f9e6ddc3
9 changed files with 156 additions and 182 deletions
@@ -78,11 +78,8 @@ export class SliderElement extends MediaElement {
});
applyElementProps(this, this.#slider.rootProps, { signal });
applyStyles(this, this.#slider.rootStyle);
this.#slider.input.subscribe(() => this.requestUpdate(), { signal });
// Prevent default touch gestures and text selection during interaction.
this.style.touchAction = 'none';
this.style.userSelect = 'none';
}
override disconnectedCallback(): void {
@@ -83,12 +83,9 @@ export class TimeSliderElement extends MediaElement {
});
applyElementProps(this, this.#slider.rootProps, { signal });
applyStyles(this, this.#slider.rootStyle);
this.#slider.input.subscribe(() => this.requestUpdate(), { signal });
// Prevent default touch gestures and text selection during interaction.
this.style.touchAction = 'none';
this.style.userSelect = 'none';
if (__DEV__ && !this.#timeState.value) {
logMissingFeature(this.localName, this.#timeState.displayName!);
}
@@ -79,12 +79,9 @@ export class VolumeSliderElement extends MediaElement {
});
applyElementProps(this, this.#slider.rootProps, { signal });
applyStyles(this, this.#slider.rootStyle);
this.#slider.input.subscribe(() => this.requestUpdate(), { signal });
// Prevent default touch gestures and text selection during interaction.
this.style.touchAction = 'none';
this.style.userSelect = 'none';
if (__DEV__ && !this.#volumeState.value) {
logMissingFeature(this.localName, this.#volumeState.displayName!);
}