Skip to content

Commit 1d9a9cd

Browse files
committed
fix: use KeyCode from rc-util
1 parent 9a64520 commit 1d9a9cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Notice.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import KeyCode from 'rc-util/lib/KeyCode';
23
import classNames from 'classnames';
34

45
export interface NoticeConfig {
@@ -51,7 +52,7 @@ const Notify = React.forwardRef<HTMLDivElement, NoticeProps & { times?: number }
5152

5253
const handleCloseKeydown: React.KeyboardEventHandler<HTMLAnchorElement> = closable
5354
? (e) => {
54-
if (e.key === 'Enter' || e.code === 'Enter' || e.keyCode === 13) {
55+
if (e.key === 'Enter' || e.code === 'Enter' || e.keyCode === KeyCode.ENTER) {
5556
onInternalClose();
5657
}
5758
}

0 commit comments

Comments
 (0)