Skip to content

Conversation

@TrySound
Copy link
Collaborator

@TrySound TrySound commented Jul 1, 2018

This diff fixes a scenario with autocomplete when clicking on item
should close menu. After calling blur input focus is still on
and since menu state depends on it menu can't be enabled again without
clicking outside of it.

<FocusManager>
  {manager =>
    <>
      <Input {...manager.bind} />
      <Menu {...manager.bind} onItemClick={manager.blur} />
    </>
  }
</FocusManager>

/cc @istarkov

This diff fixes a scenario with autocomplete when clicking on item
should close menu. After calling blur input focus is still on
and since menu state depends on t menu can't be enabled again without
clicking outside of it.

```js
<FocusManager>
  {manager =>
    <>
      <Input {...manager.bind} />
      <Menu {...manager.bind} onItemClick={manager.blur} />
    </>
  }
</FocusManager>
```
Copy link
Collaborator

@souporserious souporserious left a comment

Choose a reason for hiding this comment

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

This looks great! Nice fix 🎉

@TrySound TrySound merged commit 844e211 into master Jul 1, 2018
@TrySound TrySound deleted the natural-blur branch July 1, 2018 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants