From fa615d466c00aa888356599bcedeecbc70b237af Mon Sep 17 00:00:00 2001 From: Barsukov Nikita Date: Mon, 4 Apr 2022 17:37:42 +0300 Subject: [PATCH] chore(kit): `Slider` replace Array by Set --- projects/kit/components/slider/slider-readonly.directive.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/kit/components/slider/slider-readonly.directive.ts b/projects/kit/components/slider/slider-readonly.directive.ts index 8d0bfc3ce2336..9ceadd634711a 100644 --- a/projects/kit/components/slider/slider-readonly.directive.ts +++ b/projects/kit/components/slider/slider-readonly.directive.ts @@ -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', @@ -10,7 +10,7 @@ const SLIDER_INTERACTION_KEYS = [ 'End', 'PageUp', 'PageDown', -]; +]); /** * Native doesn't work. @@ -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); } }