ソースを参照

fix: fix dropdown onkeydown get null event (#1163)

YannLynn 3 年 前
コミット
5f7845fcc4
1 ファイル変更3 行追加3 行削除
  1. 3 3
      packages/semi-ui/dropdown/index.tsx

+ 3 - 3
packages/semi-ui/dropdown/index.tsx

@@ -248,10 +248,10 @@ class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
                         }),
                         'aria-haspopup': true,
                         'aria-expanded': popVisible,
-                        onKeyDown: e => {
+                        onKeyDown: (e: React.KeyboardEvent) => {
                             this.foundation.handleKeyDown(e);
-                            const childrenKeyDown = get(children, 'props.onKeyDown');
-                            childrenKeyDown && childrenKeyDown();
+                            const childrenKeyDown: (e: React.KeyboardEvent) => void = get(children, 'props.onKeyDown');
+                            childrenKeyDown && childrenKeyDown(e);
                         }
                     }) :
                     children}