Skip to content

Commit

Permalink
fix(core): removed up&down keys from tokens to fix rtl key handling (#…
Browse files Browse the repository at this point in the history
…13044)

deleted keys
  • Loading branch information
alexhristov14 authored Feb 19, 2025
1 parent 74eeea9 commit 52b25fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
7 changes: 0 additions & 7 deletions libs/core/multi-input/multi-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,6 @@ export class MultiInputComponent<ItemType = any, ValueType = any>
this._changeDetRef.detectChanges();
});
this._subscriptions.add(sub);
if (isListItem) {
this.openChangeHandle(false);
this.searchInputElement?.nativeElement.focus();
} else {
// stop propagation on the checkbox so event doesn't reach the list item
event.stopPropagation();
}
}

/** @hidden */
Expand Down
16 changes: 3 additions & 13 deletions libs/core/token/tokenizer.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import {
A,
BACKSPACE,
DELETE,
DOWN_ARROW,
ENTER,
LEFT_ARROW,
RIGHT_ARROW,
SPACE,
UP_ARROW
} from '@angular/cdk/keycodes';
import { A, BACKSPACE, DELETE, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE } from '@angular/cdk/keycodes';
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
import {
AfterViewInit,
Expand Down Expand Up @@ -482,7 +472,7 @@ export class TokenizerComponent implements AfterViewInit, OnDestroy, CssClassBui
* Check whether user intends to go back to the previous token
**/
private _goBackRequested($event: KeyboardEvent, rtl: boolean): boolean {
const backKeys = rtl ? [RIGHT_ARROW, DOWN_ARROW] : [LEFT_ARROW, UP_ARROW];
const backKeys = rtl ? [RIGHT_ARROW] : [LEFT_ARROW];
return KeyUtil.isKeyCode($event, backKeys);
}

Expand All @@ -491,7 +481,7 @@ export class TokenizerComponent implements AfterViewInit, OnDestroy, CssClassBui
* Check whether user intends to go forward to the next token
**/
private _goForwardRequested($event: KeyboardEvent, rtl: boolean): boolean {
const forwardKeys = rtl ? [LEFT_ARROW, UP_ARROW] : [RIGHT_ARROW, DOWN_ARROW];
const forwardKeys = rtl ? [LEFT_ARROW] : [RIGHT_ARROW];
return KeyUtil.isKeyCode($event, forwardKeys);
}

Expand Down

0 comments on commit 52b25fa

Please sign in to comment.