Skip to content

Commit d7a17cd

Browse files
fix: disable click
1 parent 5b1a920 commit d7a17cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/PickerInput/Selector/Input.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
153153
};
154154

155155
const onFormatPaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {
156+
// Block paste until selection is set (after mouseUp when focus was by mousedown)
157+
if (mouseDownRef.current) {
158+
event.preventDefault();
159+
return;
160+
}
161+
156162
// Get paste text
157163
const pasteText = event.clipboardData.getData('text');
158164

@@ -221,6 +227,12 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
221227
};
222228

223229
const onFormatKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
230+
// Block key input until selection is set (after mouseUp when focus was by mousedown)
231+
if (mouseDownRef.current) {
232+
event.preventDefault();
233+
return;
234+
}
235+
224236
onSharedKeyDown(event);
225237

226238
const { key } = event;

0 commit comments

Comments
 (0)