Skip to content

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

Merged
silviuaavram merged 2 commits into
v6from
fix/clear-close-on-escape
Jul 5, 2020
Merged

fix: on escape, close menu and clear selection only if menu is closed#1110
silviuaavram merged 2 commits into
v6from
fix/clear-close-on-escape

Conversation

@silviuaavram

@silviuaavram silviuaavram commented Jul 5, 2020

Copy link
Copy Markdown
Collaborator

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