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] options list fails to open when icon clicked with animated width #7170

Closed
nickofthyme opened this issue Sep 8, 2023 · 10 comments
Labels
bug help wanted The EUI team is looking for community members to pick up and implement this issue

Comments

@nickofthyme
Copy link
Contributor

nickofthyme commented Sep 8, 2023

Describe the bug
Clicking the dropdown icon EuiComboBox with flex-grow styles on parent causes failed focus and options list to never open. See gif below....

Screen Recording 2023-09-08 at 10 06 18 AM

Impact and severity
The issue is likely pretty rare to encounter and has a workaround to manually focus the input with onFocus callback, without animations.

Environment and versions

  • EUI version: 88.1.0
  • Kibana version: 8.11.0

Expected behavior
Dropdown opens options when input or icon is clicked.

Minimum reproducible sandbox

https://codesandbox.io/s/white-cookies-pp783k?file=/src/App.tsx

Additional context

This bug only seems to appear when the icon is moving such that when focused the element widens and the icon shifts. If the element width grows but the icon does not move, the focus works correctly, see this with the right EuiComboBox in the demo.

Screen Recording 2023-09-08 at 10 10 28 AM

Ideally the solution to this allows for animating the width without being glitchy.

@nickofthyme nickofthyme added bug ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible labels Sep 8, 2023
@JasonStoltz
Copy link
Member

JasonStoltz commented Sep 11, 2023

Hey @nickofthyme.

I'm unsure if this is UI we want to encourage in Kibana. Is this an established pattern elsewhere?

CC @andreadelrio

@andreadelrio
Copy link
Contributor

Hey @nickofthyme.

I'm unsure if this is UI we want to encourage in Kibana. Is this an established pattern elsewhere?

CC @andreadelrio

Hi @JasonStoltz. We do something similar with the KQL input in the Unified Search Bar. This is a last-resort type of situation where we have decided on this solution given that the fix on EUI seems very hard to achieve and has been closed as not-planned. Our best-case scenario would be for EuiComboBox to expand its dropdown to display the values without any cutoffs.

@nickofthyme
Copy link
Contributor Author

@JasonStoltz I agree the usage would be pretty rare and discouraged, only to be used in certain cases. But those cases, like KQL and the unified search filter are highly visible/used components and would be nice to smooth out the width change with an animation. Not absolutely necessary but a nice to have eventually.

@JasonStoltz
Copy link
Member

Thank you for the additional context. We'll review with the team.

@cee-chen
Copy link
Member

cee-chen commented Sep 18, 2023

Would #7192 be a better option instead? (expanding the popover width instead of the entire input)

@nickofthyme nickofthyme changed the title [EuiComboBox] options list fails to open when icon clicked [EuiComboBox] options list fails to open when icon clicked with animated width Sep 18, 2023
@nickofthyme
Copy link
Contributor Author

nickofthyme commented Sep 18, 2023

@cee-chen I don't think so since the usage for the unified search filter input is to show the selected value with minimal truncation. @andreadelrio may have a better take on the matter.

@breehall breehall added the help wanted The EUI team is looking for community members to pick up and implement this issue label Sep 19, 2023
@github-actions
Copy link

👋 Thank you for your suggestion or request! While the EUI team agrees that it's valid, it's unlikely that we will prioritize this issue on our roadmap. We'll leave the issue open if you or anyone else in the community wants to implement it by contributing to EUI. If not, this issue will auto close in one year.

@breehall breehall removed the ⚠️ needs validation For bugs that need confirmation as to whether they're reproducible label Sep 19, 2023
@cee-chen
Copy link
Member

@andreadelrio Definitely let us know if you'd like to brainstorm an alternative UX approach/solution!

@nickofthyme As a heads up this is pretty low priority for us, primarily due to the this being kind of an edge case UX interaction most consumers won't ever encounter. That being said, we have a CSS-only workaround you could consider using: check out the following CodeSandbox: https://codesandbox.io/s/xenodochial-resonance-3r5w5j?file=/src/App.tsx:307-512

The primary workaround uses CSS pointer-events to avoid click shenanigans on the arrow icon:

  [data-test-subj="comboBoxToggleListButton"] {
    pointer-events: none;
  }

The other following selectors optionally restore cursor indicators for mouse users:

  .euiComboBox__inputWrap {
    cursor: pointer;
  }
  .euiComboBoxPill--plainText,
  .euiComboBox__input {
    cursor: text;
  }

@nickofthyme
Copy link
Contributor Author

Yeah I get it's a low priority just making note for you all to do with as you wish. Thanks @cee-chen I'll take a look.

@cee-chen
Copy link
Member

Closing this as a wontfix. This is an issue specific to a consumer usage of EuiComboBox, and is addressable by an alternate (and better in terms of a11y) approach implemented in elastic/kibana#171439

@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted The EUI team is looking for community members to pick up and implement this issue
Projects
None yet
Development

No branches or pull requests

5 participants