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

'InputBlur' event is not triggered after menu is closed with Escape #1630

Open
iobuhov opened this issue Dec 12, 2024 · 0 comments
Open

'InputBlur' event is not triggered after menu is closed with Escape #1630

iobuhov opened this issue Dec 12, 2024 · 0 comments

Comments

@iobuhov
Copy link

iobuhov commented Dec 12, 2024

  • downshift version: 9.0.8
  • node version: 22.10.0
  • npm (or yarn) version: 10.9.0

What you did:
I found that InputBlur event is not triggered when focus is moved away from combobox input.
This behavior is observable only when user closes menu with Escape.

Reproduction repository:
I don't have repository, but I was using example code from Combobox/Controlling state section
Here is the steps to reproduce the issue:

  1. Open "Controlling state" example from "useCombobo" page
  2. In editor add onStateChange: (change) => console.log(change),
  3. Focus combobox
  4. Close menu by pressing "Esc"
  5. Press tab to move focus
  6. Check the console

Expected:

{type: 10, isOpen: true}
{type: 2, isOpen: false}
{type: 9, isOpen: false}

Actual:

{type: 10, isOpen: true}
{type: 2, isOpen: false}

As you can see blur event is not triggered.
NOTE: When onBlur callback is added to input, it actually get called

{...getInputProps({
  onBlur() { console.log("blur") }
})}
{type: 10, isOpen: true}
{type: 2, isOpen: false}
blur

Problem description:

Suggested solution:

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

No branches or pull requests

1 participant