Merge pull request #16918 from oakslab/master

fix: cascader unable to enter space during search #16871
This commit is contained in:
偏右 2019-06-02 19:41:04 +08:00 committed by GitHub
commit 7c0fd87b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,8 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
};
handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.keyCode === KeyCode.BACKSPACE) {
// SPACE => https://github.com/ant-design/ant-design/issues/16871
if (e.keyCode === KeyCode.BACKSPACE || e.keyCode === KeyCode.SPACE) {
e.stopPropagation();
}
};