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

EuiSelectableTemplateSitewide requires 2 clicks to trigger onChange events #5020

Closed
afharo opened this issue Aug 12, 2021 · 1 comment · Fixed by #5021
Closed

EuiSelectableTemplateSitewide requires 2 clicks to trigger onChange events #5020

afharo opened this issue Aug 12, 2021 · 1 comment · Fixed by #5021
Assignees
Labels

Comments

@afharo
Copy link
Member

afharo commented Aug 12, 2021

We noticed in Kibana (elastic/kibana#98851) that the component EuiSelectableTemplateSitewide sometimes requires 2 clicks to trigger the onChange events.

I'm able to reproduce this error in Chrome and Safari, but it works as expected on Firefox.

The issue:

  1. Search any term that brings more than 7 items, so you need to scroll
  2. Scroll down and click on any item from the 7th position onwards
  3. Notice that the list goes back to the top, and still claims that the active item is the first one (not checked though).
  4. Try again, and notice that it now selects the expected item.

not-ok

I think that it must be related to some initial wrong state because, if you click any of the initially-visible items and then scroll to the intended item, it works as expected.
successful

@afharo
Copy link
Member Author

afharo commented Aug 12, 2021

It looks like there was a fix for it in #4152. But it's no longer working on Chrome and Safari.

I managed to stop the issue from happening by not setting activeOptionIndex: undefined, in this event handler.

@elastic/elastic-ui and @elastic/eui-design, do you think we can stop setting this value at this given point?

cc @myasonik as he applied the fix and may have some insights

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.

1 participant