Skip to content

Commit

Permalink
fix(CascaderSelect): focus to input after select (#3712)
Browse files Browse the repository at this point in the history
  • Loading branch information
潕量 committed Mar 25, 2022
1 parent ca84bc9 commit bd1d44f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cascader-select/cascader-select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bd1d44f

Please sign in to comment.