Skip to content

Commit

Permalink
chore(kit): Slider replace Array by Set
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Apr 4, 2022
1 parent 202c39b commit fa615d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/kit/components/slider/slider-readonly.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Directive, HostListener, Input} from '@angular/core';
import {tuiDefaultProp} from '@taiga-ui/cdk';

const SLIDER_INTERACTION_KEYS = [
const SLIDER_INTERACTION_KEYS = new Set([
'ArrowLeft',
'ArrowRight',
'ArrowUp',
Expand All @@ -10,7 +10,7 @@ const SLIDER_INTERACTION_KEYS = [
'End',
'PageUp',
'PageDown',
];
]);

/**
* Native <input type='range' readonly> doesn't work.
Expand All @@ -34,7 +34,7 @@ export class TuiSliderReadonlyDirective {

@HostListener('keydown', ['$event'])
preventKeyboardInteraction(event: KeyboardEvent) {
if (SLIDER_INTERACTION_KEYS.includes(event.key)) {
if (SLIDER_INTERACTION_KEYS.has(event.key)) {
this.preventEvent(event);
}
}
Expand Down

0 comments on commit fa615d4

Please sign in to comment.