Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoComplete] Fix openOnFocus behavior #3664

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/auto-complete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ const AutoComplete = React.createClass({
}
},

handlePopoverRequestClose() {
if (this.refs.searchTextField && !this.refs.searchTextField.state.isFocused) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we solve the issue without using a ref?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to learn how. 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm investigating. Expect a PR if I find how.

this.close();
}
},

blur() {
this.refs.searchTextField.blur();
},
Expand Down Expand Up @@ -526,7 +532,7 @@ const AutoComplete = React.createClass({
open={open}
anchorEl={anchorEl}
useLayerForClickAway={false}
onRequestClose={this.close}
onRequestClose={this.handlePopoverRequestClose}
animated={animated}
>
{menu}
Expand Down