Skip to content

Commit 66f5557

Browse files
committed
fix : KeyUp Event
1 parent d731fed commit 66f5557

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

package/src/components/UI/Alert.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ const Alert = ({ message, onClose }: IProps) => {
2323
}, [onClose]);
2424

2525
useEffect(() => {
26-
okRef.current?.focus();
26+
setTimeout(() => {
27+
okRef.current?.focus();
28+
});
2729
}, []);
2830

2931
return (

package/src/components/UI/Confirm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ const Confirm = ({ message, onClickOK, onClickCancel }: IProps) => {
2525
}, [onClickCancel]);
2626

2727
useEffect(() => {
28-
okRef.current?.focus();
28+
setTimeout(() => {
29+
okRef.current?.focus();
30+
});
2931
}, []);
3032

3133
return (

package/src/components/UI/Prompt.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const Prompt = ({ message, _default, onClickOK, onClickCancel }: IProps) => {
3434
};
3535

3636
useEffect(() => {
37-
inputRef.current?.focus();
37+
setTimeout(() => {
38+
inputRef.current?.focus();
39+
});
3840
}, []);
3941

4042
return (

package/src/components/UI/Wrapper.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ interface IProps {
77
}
88

99
const DialogWrapper = ({ children }: IProps) => {
10-
const stopPropagation = (e: React.KeyboardEvent<HTMLDivElement>) => {
11-
console.log('stopPropagation');
12-
e.stopPropagation();
13-
};
14-
1510
return (
16-
<div className="react-dialog__wrapper" onKeyUpCapture={stopPropagation}>
11+
<div className="react-dialog__wrapper">
1712
<div className="react-dialog__dialog">{children}</div>
1813
</div>
1914
);

package/src/components/dialog/AlertDialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function AlertDialog({ children }: IProps) {
2020
setState({
2121
message: message !== undefined ? `${message}` : '',
2222
onClose: () => {
23-
console.log('onClick');
2423
setState(undefined);
2524
resolve(undefined);
2625
},

0 commit comments

Comments
 (0)