Skip to content

Commit b8bb7e1

Browse files
fix: update
1 parent d87b9d1 commit b8bb7e1

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

src/PickerInput/Selector/Input.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -227,29 +227,16 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
227227
};
228228

229229
const onFormatKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
230-
onSharedKeyDown(event);
231-
232-
const { key } = event;
233-
234-
// Block mask editing until selection is set (after mouseUp when focus was by mousedown).
235-
// Still allow shared handlers (onKeyDown, Enter submit) above to run.
230+
// Block key input until selection is set (after mouseUp when focus was by mousedown)
236231
if (mouseDownRef.current) {
237-
const shouldBlock =
238-
key.length === 1 ||
239-
key === 'Backspace' ||
240-
key === 'Delete' ||
241-
key === 'ArrowLeft' ||
242-
key === 'ArrowRight' ||
243-
key === 'ArrowUp' ||
244-
key === 'ArrowDown';
245-
246-
if (shouldBlock) {
247-
event.preventDefault();
248-
}
249-
232+
event.preventDefault();
250233
return;
251234
}
252235

236+
onSharedKeyDown(event);
237+
238+
const { key } = event;
239+
253240
// Save the cache with cell text
254241
let nextCellText: string = null;
255242

0 commit comments

Comments
 (0)