From 6a2537d6f891761daf591411586f0bc3e372378b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=95=E9=87=8F?= Date: Thu, 27 Jan 2022 14:19:07 +0800 Subject: [PATCH] fix(CascaderSelect): focus to input after select (#3712) --- src/cascader-select/cascader-select.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cascader-select/cascader-select.jsx b/src/cascader-select/cascader-select.jsx index 4f0692bb54..fd83872d8b 100644 --- a/src/cascader-select/cascader-select.jsx +++ b/src/cascader-select/cascader-select.jsx @@ -552,7 +552,8 @@ class CascaderSelect extends Component { } if (['fromCascader', 'keyboard'].indexOf(type) !== -1 && !visible) { - this.select.focusInput(); + // 这里需要延迟下,showSearch 的情况下通过手动设置 menuProps={{focusable: true}} 回车 focus 会有延迟 + setTimeout(() => this.select.focusInput(), 0); } this.props.onVisibleChange(visible, type);