Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for slider input events #362

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/SliderInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ class SliderInput extends Element implements IBindable, IFocusable, IPlaceholder

protected _onSlideStart(pageX: number) {
this._domHandle.focus();
window.addEventListener('pointermove', this._onPointerMove);
window.addEventListener('pointerup', this._onPointerUp);
this._domSlider.addEventListener('pointermove', this._onPointerMove);
this._domSlider.addEventListener('pointerup', this._onPointerUp);

this.class.add(CLASS_SLIDER_ACTIVE);

Expand Down Expand Up @@ -283,8 +283,8 @@ class SliderInput extends Element implements IBindable, IFocusable, IPlaceholder

this.class.remove(CLASS_SLIDER_ACTIVE);

window.removeEventListener('pointermove', this._onPointerMove);
window.removeEventListener('pointerup', this._onPointerUp);
this._domSlider.removeEventListener('pointermove', this._onPointerMove);
this._domSlider.removeEventListener('pointerup', this._onPointerUp);

if (this.binding) {
this.binding.historyCombine = this._historyCombine;
Expand Down
12 changes: 6 additions & 6 deletions src/components/SliderInput/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

// active state
.pcui-slider-active {
cursor: ew-resize;

.pcui-slider-bar {
border-color: $bcg-darkest;
background-color: $bcg-darkest;
Expand All @@ -61,10 +59,6 @@

// hover state
.pcui-slider:not(.pcui-disabled, .pcui-readonly) {
&:hover {
cursor: pointer;
}

.pcui-slider-handle {
&:focus,
&:hover {
Expand All @@ -76,6 +70,12 @@
}
}

.pcui-slider {
cursor: pointer;
&.pcui-slider-active {
cursor: ew-resize;
}
}
// readonly state (hide slider)
.pcui-slider.pcui-readonly {
.pcui-numeric-input {
Expand Down
Loading