-
Notifications
You must be signed in to change notification settings - Fork 844
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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] Improve changing selection by highlighting current text #8043
Comments
@mdefazio Is what you describe a standard behavior for combo boxes? |
It seems to me the solution here is to highlight the current text when focused. If you focus the combobox by tabbing to it, currently, it does work that way. So in this case, we'd be changing it so that any focus event highlights the text, including a click. This behavior can be seen in Material UI: https://mui.com/material-ui/react-autocomplete/#combo-box Does this make sense? mui.mp4
Can you provide any additional context or evidence here? |
My (very) informal 2c: I would personally hate this UX as a user, although in general I just hate my mouse being hijacked 😅 Just throwing out another scenario that this would add friction for: let's say I started typing to search, made a small typo, tabbed away to google the correct spelling (which causes the combo box to lose focus) and tabbed back and wanted to insert a character in the middle of my typo - I'd be super annoyed that I couldn't do so and my click is getting hijacked. I also worry it might be an accessibility concern(?), although that's maybe an unfounded concern. It is worth noting that W3's combobox patterns does not include this UX: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-both/ |
Yes. I think this is correct.
We've noticed folks reviewing our semantic text mapping flows consistently getting tripped up on this. I can't speak to this happening in more places with similar frustration though.
Not sure I follow here. If the text is simply highlighted when clicking into it, using the arrow keys to fix your typo would still work and I could fix the typo. Right? I would also say that typing halfway, then googling a correct spelling before completing is more of an edge case than a common scenario. I'm not sure how to go about seeing if the current way is more ideal for other situations. Happy to explore other component options as well. This usage just exposes this UX nuance moreso through a repetitive action (adding multiple fields) and having to constantly select all the text first. |
To clarify I meant clicking to a specific character while typing, not using arrow keys to get to where I want. I'm kind of an oddball user in terms of mouse UX though (I click a lot, everywhere, almost at random) so I'm not necessarily the most common use case here. Definitely agreed that more data/research would help! |
Following up on as I wasn't sure if we were all on the same page...
I think so. Maybe more 'common' than 'standard'.
Confirmed. This is my expectation as well. Do we think it's worthwhile to go through the various usages in Kibana to see what this would change? I'm happy to help here, but I don't know how to go about this portion of work. If we are simply highlighting the text as shown in @JasonStoltz 's example, do we feel this is a concerning enough change to do that audit? |
FWIW, I'll drop my two-cents here. In either direction (highlight or no-highlight on mouse focus), there will always exist a scenario where it isn't ideal. If the experience the combo box is embedded within leans more toward users typing new strings every time they interact with the combobox (ex. searching or typing a custom value), then having the highlight would be more efficient. On the other hand, if the experience leans more towards a situation where the user is more likely to make minor edits to an existing string (ex. URL or IP address), then not having the highlight would be more efficient. In all honesty, the combo box component is used in so many places across Kibana, I'd hesitate to presume that one case is more common than the other. We could of course consider the possibility of making the focus behavior a prop on the combo box component that could be toggled on/off depending on the context it is used. However, I would have concerns about that sort of approach as well, as it would introduce a behavioral inconsistency with no affordance provided for the user. As @JasonStoltz mentions above, the current EUI combo box honors the default browser behavior by either A) highlighting the string of text on keyboard focus, or B) placing a text cursor at the position specified on mouse focus. In looking at other design systems, I'm seeing examples in both directions, with no one clear winning pattern. Given the hazy nature of the topic, I'm personally inclined to keep it the way it currently operates as it honors default browser behavior. However, if there is compelling evidence that combo box usage across all of Kibana is better suited to always highlight the full text string on mouse focus (in addition to the semantic text mapping flows already mentioned), I could certainly be persuaded otherwise. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The verdict appears to be that without compelling evidence to suggest that one approach is better than another, we will leave this component as is. For that reason, I am closing this issue. If someone brings a strong case for this change, we are happy to reopen this issue and reconsider. |
Can we clarify this a bit more?:
Where does this component honor the default behavior of highlighting the string on focus? This was the expected behavior originally, so if i'm missing a way to implement this, let me know. How is that this honors both of those scenarios? Seems to me it's a one or the other for how we handle focus? Am I misunderstanding you @MichaelMarcialis |
Highlighting a full string of text on keyboard focus and placing a text cursor at the position specified on mouse focus is default browser HTML
Not sure I'm understanding here. Mind elaborating? I'm just saying that the behavior is different depending on whether a user is tab focusing or mouse focusing the element. |
Ah, I see your point. Ignore my last comment then. So maybe this will help bring context to where I'm at and you all can correct me on any of these points:
If we take two of the most common scenarios in Kibana, selecting a Data view and selecting a field type, we have two different experiences: Selecting a Data View
CleanShot.2024-10-17.at.12.30.28.mp4And the same page, but without the extra affordances of creating a new one, switching language, etc. For both of these, we force the user to do an extra click or tab into the search bar and retype (without pre-filling the current option—so I have to start fresh if I only want to change a portion) Selecting a field type When setting up filters, and I click into the field dropdown, my expectation (and behavior) is that I am replacing the entire string with my selection. (I'm not placing my cursor and appending my selection. So it seems to me that clicking into this dropdown should have the same behavior as tabbing into it, since my expectation is that i'm replacing my selection with a new one. CleanShot.2024-10-17.at.12.54.48.mp4The experience with these should be different than a simple search bar showing results. Here, I absolutely want to put the cursor where I clicked and update my search term. CleanShot.2024-10-17.at.12.41.03.mp4Yes, |
Thanks for that context, @mdefazio! I agree with you that when the So how do we proceed? I imagine we can take one of three possible directions:
Personally I lean more towards options 1 and 3, but curious to hear what ya'll think. |
@MichaelMarcialis Thanks for summarizing those options. Obvs...my choice is 3. But maybe there's an option 4 (which you elude to...) The need here is to have a single select dropdown with search, so perhaps improving |
This fourth option you describe would indeed be interesting. Since you mentioned that the list of selectable options you need to support is long, does that mean virtualization is required as well? If so, that may be a determining factor, as I don't think As a side note, I'd personally love to see our number of selector components reduced from three ( |
Alright, so we took this offline and discuss. The conclusion is this: We're not totally aligned that this is a change we want to apply across the board yet. @cee-chen Will provide @mdefazio a snippet to allow him to apply this behavior to just this one particular flow, as it is especially important in this use case. @mdefazio Will ask the dev team to include a link to this issue in a comment in code to track this behavior as a one-off. In the future, or after some validation on Michael and team's side, we may choose to adopt this as a supported behavior for Combobox. In the meantime, I will move this issue to a discussion. We will re-open it as an issue if we decide to adopt it into the backlog as a feature to add. @MichaelMarcialis @mdefazio @cee-chen Can ya'll drop a 👍 on this issue if you agree? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the solution you'd like
When changing options in the combobox with only single selection available, the current option should be highlighted so I can start typing the new option.
CleanShot.2024-09-25.at.15.26.09.mp4
Happy to discuss some alternatives or pushback on this. I acknowledge that using the keyboard to select all is easy here. But it does trip folks up for a second when interacting with this component.
Desired timeline
This occurs on the add field mappings flows, and these have a lot of focus within the company at the moment.
The text was updated successfully, but these errors were encountered: