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

Closed

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

Activity

  1. rahulbhadja commented on Mar 13, 2023

    @rahulbhadja

    @breehall looking into it.

  2. cee-chen commented on Mar 20, 2023

    @cee-chen
    Contributor

    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.

  3. added and removed on May 11, 2023
  4. self-assigned this
    on Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions