Skip to content

Commit

Permalink
fix(player): slider should not respond to key events when disabled
Browse files Browse the repository at this point in the history
closes #1390
  • Loading branch information
mihar-22 committed Sep 14, 2024
1 parent 3e9867c commit 67e8169
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ export class SliderEventsController extends ViewController<
#attachEventListeners(el: HTMLElement) {
const { hidden } = this.$props;

new EventsController(el)
.add('focus', this.#onFocus.bind(this))
.add('keyup', this.#onKeyUp.bind(this))
.add('keydown', this.#onKeyDown.bind(this));
listenEvent(el, 'focus', this.#onFocus.bind(this));

if (hidden() || this.#delegate.isDisabled()) return;

new EventsController(el)
.add('keyup', this.#onKeyUp.bind(this))
.add('keydown', this.#onKeyDown.bind(this))
.add('pointerenter', this.#onPointerEnter.bind(this))
.add('pointermove', this.#onPointerMove.bind(this))
.add('pointerleave', this.#onPointerLeave.bind(this))
Expand Down

0 comments on commit 67e8169

Please sign in to comment.