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

[EuiComboBox] hasMatchingOptions arg in onSearchChange function appears to be a step behind when value switches from true to false (or vice versa) #6638

Closed
rachelhathaway opened this issue Mar 8, 2023 · 2 comments · Fixed by #7334
Assignees
Labels

Comments

@rachelhathaway
Copy link

Issue
When using the onSearchChange prop with the EuiComboBox component, the transition from true to false (or vice versa) of the hasMatchingOptions argument appears to be a step behind.

Expected behavior
The value of hasMatchingOptions should immediately reflect whether or not the entered value matches any of the combo box options.

To reproduce

  1. Visit https://codesandbox.io/s/smoosh-fast-oo7upo?file=/demo.js
  2. Expand the console
  3. Type bee in the combo box's input. Note in the console that hasMatchingOptions is true for b and be as expected, but it remains true for bee, where it should be false.
  4. Type r in the combo box's input. Note in the console that hasMatchingOptions value is now correctly set to false.
  5. Delete er from the input so you're left with be. hasMatchingOptions should be true again, but it's still false.

Let me know if I can add any further clarity, I'm not sure I've described this very well. 😅

@breehall breehall added the bug label Mar 9, 2023
@rahulbhadja
Copy link

@breehall looking into it.

@cee-chen
Copy link
Member

I can confirm this bug is reproducible. It may be worth noting that it may automatically resolve if/when we change the internals of EuiComboBox to use EuiSelectable (#2841). However, an interim bugfix may also be preferable if the above meta takes a while to accomplish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants