Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onKeyDown: (e: KeyboardEvent) => {
if (e.keyCode === KEY_CODES.DELETE || e.keyCode === KEY_CODES.BACKSPACE) {
e.preventDefault();
removeValue();
}
if (e.keyCode === KEY_CODES.END && !inputValue) {
inputRef.current && inputRef.current.focus();
e.preventDefault();
}
if (isRtl(props)) {
if (e.keyCode === KEY_CODES.RIGHT && index === 0) {
e.preventDefault();
}
if (e.keyCode === KEY_CODES.LEFT && index === selectedItems.length - 1) {
e.preventDefault();