Skip to content

[EuiComboBox] Fix Entering to select items within groups#7658

Merged
cee-chen merged 4 commits intoelastic:mainfrom
cee-chen:combobox/group-label-enter-fix
Apr 8, 2024
Merged

[EuiComboBox] Fix Entering to select items within groups#7658
cee-chen merged 4 commits intoelastic:mainfrom
cee-chen:combobox/group-label-enter-fix

Conversation

@cee-chen
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen commented Apr 7, 2024

Summary

closes #7653

See the below QA steps

QA

  • Go to https://eui.elastic.co/pr_7658/#/forms/combo-box#groups
  • Type in the full text (in lower case) for any of the options within groups (e.g. red or pop)
  • Once the matching option is the only match aside from its group label (see below example screenshot), press Enter
  • Confirm the correctly capitalized label (i.e. the original option) is selected/added
  • For comparison against current production - this works but adds the lower case text (instead of the actual original option) due to the existing onCreateOption callback.

General checklist

  • Browser QA
    • Checked for accessibility including keyboard-only and screenreader modes
      - [ ] Checked in both light and dark modes
      - [ ] Checked in mobile
      - [ ] Checked in Chrome, Safari, Edge, and Firefox
  • Docs site QA
    • Updated some unclear docs
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
      - [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist - N/A

cee-chen added 4 commits April 7, 2024 11:29
- remove a ton of now-unnecessary lowercase normalization checks that EuiComboBox handles automatically

- had a `custom` undefined error on every new custom creation that was due to too many `setAllOptions` calls - use a callback and an `=` destructure fallback to fix all those things
@cee-chen cee-chen marked this pull request as ready for review April 7, 2024 18:54
@cee-chen cee-chen requested a review from a team as a code owner April 7, 2024 18:54
@kibanamachine
Copy link
Copy Markdown

Preview staging links for this PR:

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 🐈‍⬛ LGTM!

Copy link
Copy Markdown
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cee-chen I noticed one more issue, but maybe it's by design? When you have more than one options but one is exact, it's not gonna get chosen. I noticed it by checking this case:

Screenshot 2024-04-08 at 15 46 28

I am ok if that's how it is supposed to work, and sorry for commenting in only vaguely related PR 😬

@cee-chen
Copy link
Copy Markdown
Contributor Author

cee-chen commented Apr 8, 2024

@mbondyra You're totally good!! It is by design, yes, I assume to reduce ambiguity. Users can still access the first option via keyboard only by using the down arrow key to highlight it and then pressing Enter.

@cee-chen cee-chen merged commit 5f23b06 into elastic:main Apr 8, 2024
@cee-chen cee-chen deleted the combobox/group-label-enter-fix branch April 8, 2024 15:41
cee-chen added a commit to elastic/kibana that referenced this pull request Apr 9, 2024
`v93.5.2` ⏩ `v93.6.0`

---

## [`v93.6.0`](https://github.com/elastic/eui/releases/v93.6.0)

- Updated `EuiBreadcrumb` styles to improve visual distinction of
clickable breadcrumbs
([#7615](elastic/eui#7615))

**Deprecations**

- Deprecated `color` prop on `EuiBreadcrumb`
([#7615](elastic/eui#7615))

**Bug fixes**

- Fixed `EuiComboBox` to correctly select full matches within groups via
the `Enter` key ([#7658](elastic/eui#7658))

**Accessibility**

- Updated `EuiHeaderBreadcrumb` styles to ensure min. required color
contrast ([#7643](elastic/eui#7643))
- `EuiSuperSelect` now correctly reads out parent `EuiFormRow` labels to
screen readers ([#7650](elastic/eui#7650))
- `EuiSuperSelect` now more closely mimics native `<select>` behavior in
its keyboard behavior and navigation
([#7650](elastic/eui#7650))
- `EuiSuperSelect` no longer strands keyboard focus on close
([#7650](elastic/eui#7650))
- `EuiSuperSelect` now correctly allows keyboard navigating past
disabled options in the middle of the options list
([#7650](elastic/eui#7650))
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

Successfully merging this pull request may close these issues.

[EuiCombobox] Cannot choose item by hitting enter if it's in a subgroup

5 participants