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

fix: on escape, close menu and clear selection only if menu is closed #1110

Merged
merged 2 commits into from
Jul 5, 2020

Conversation

silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Jul 5, 2020

What:

On Escape, if the menu is open, close it. If menu is closed, clear inputValue and selectedItem.

Why:

To close #719.

How:

In downshift revert to the previous behavior before the clear change was introduced.
In useCombobox change the reducer to clear inputValue and selectedItem if state.isOpen is false.

Checklist:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@silviuaavram silviuaavram changed the base branch from master to v6 July 5, 2020 12:39
@silviuaavram silviuaavram merged commit 3496289 into v6 Jul 5, 2020
@silviuaavram silviuaavram deleted the fix/clear-close-on-escape branch July 5, 2020 12:53
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.

onChange called with null when esc pressed
1 participant