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

Search and Selecting Option Sometimes Does Not Select Option #345

Open
mnorthern2 opened this issue Jul 29, 2024 · 6 comments
Open

Search and Selecting Option Sometimes Does Not Select Option #345

mnorthern2 opened this issue Jul 29, 2024 · 6 comments

Comments

@mnorthern2
Copy link

We've noticed a bug when using this plugin when using a single select in combination with the search property. Sometimes, when using the search function to narrow down to a single result, clicking the option will close the dropdown without selecting the option.

We've noticed this happens in tandem with some listeners, so it's not completely isolated. Here's the general flow of it:

  1. Options are populated via an API call from a listener on a different field
  2. The user searches for the desired option
  3. The user selects the option
  4. A listener is fired off. This listener does the following (in order)
    • Options are remade (but not populated yet) due to some business logic
    • The listener is temporarily removed
    • The options are re-set using setOptions. To ensure no stale data, the keepValue argument is not set.
    • The option that was originally selected when the listener was fired is re-set using the setValue method. The disableEvent argument is true
    • The listener is added back
@gnbm
Copy link
Collaborator

gnbm commented Aug 22, 2024

@mnorthern2 could you provide a replication sample?

@mnorthern2
Copy link
Author

The reproduction I currently have is proprietary for my company. I'll work on isolating an example though!

I will note that this definitely has something to do with some sort of listener. On other, simpler pages, the same functionality works with no issue.

@mnorthern2
Copy link
Author

mnorthern2 commented Sep 5, 2024

@gnbm I got around to creating a replication sample!

https://gist.github.com/mnorthern2/ded731f34eb11a6b2917ef0f61db9a30

Replication steps:

  1. Load the gist
  2. Wait for the second dropdown to load its options
  3. Search for any option (options are labeled Option i where i is a number between 1 and 10
  4. Click on the resulting option (using the keyboard works as expected)
  5. Note that the option was not selected

I have not checked other browsers, so for completeness, this is using Chrome.

@mnorthern2
Copy link
Author

Just commenting to make it known that this is still an issue/keep the issue from automatically locking.

@rupeshkolhebb
Copy link

rupeshkolhebb commented Nov 15, 2024

@mnorthern2 I am facing exactly the same issue, any work around you found so far?

This is happening only in case of single select dropdown with search option enabled.

@mnorthern2
Copy link
Author

@mnorthern2 I am facing exactly the same issue, any work around you found so far?

This is happening only in case of single select dropdown with search option enabled.

I unfortunately have not. I traced some of the source code at one point and I believe it was an issue with an event listener, but that'd require modifying the library manually.

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

3 participants