fix: 修复 tree-select 搜索后需要点击两次才能点中子节点问题 (#4558)

* fix: 修复 tree-select 搜索后需要点击两次才能点中子节点问题

* fix: 修复 tree-select 搜索后需要点击两次才能点中子节点问题
This commit is contained in:
吴多益 2022-06-08 13:45:50 +08:00 committed by GitHub
parent 22907c16a4
commit 0ee35f53ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 50885 deletions

2
.gitignore vendored
View File

@ -29,3 +29,5 @@ node_modules
dist
tsconfig.tsbuildinfo
lerna-debug.log
.rollup.cache
package-lock.json

50870
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
/lib
lib/
/node_modules
/esm
/.rollup.cache
/tsconfig.tsbuildinfo
/coverage
/coverage

View File

@ -1,6 +1,6 @@
/dist
/lib
/sdk
lib
sdk
/public
/gh-pages
/output

View File

@ -108,7 +108,6 @@ export interface TreeSelectProps extends OptionsControlProps {
export interface TreeSelectState {
isOpened: boolean;
isFocused: boolean;
inputValue: string;
}
@ -153,8 +152,7 @@ export default class TreeSelectControl extends React.Component<
this.state = {
inputValue: '',
isOpened: false,
isFocused: false
isOpened: false
};
this.open = this.open.bind(this);
@ -202,9 +200,6 @@ export default class TreeSelectControl extends React.Component<
handleFocus(e: any) {
const {dispatchEvent, value, data} = this.props;
this.setState({
isFocused: true
});
dispatchEvent(
'focus',
createObject(data, {
@ -215,9 +210,6 @@ export default class TreeSelectControl extends React.Component<
handleBlur(e: any) {
const {dispatchEvent, value, data} = this.props;
this.setState({
isFocused: false
});
dispatchEvent(
'blur',
createObject(data, {
@ -647,7 +639,6 @@ export default class TreeSelectControl extends React.Component<
'TreeSelect--searchable':
searchable || isEffectiveApi(autoComplete),
'is-opened': this.state.isOpened,
'is-focused': this.state.isFocused,
'is-disabled': disabled
})}
result={