Skip to content

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

@rachelhathaway

Description

@rachelhathaway

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. 😅

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions