Skip to content

feat(search_bar): Add isInvalidTooltipDisabled prop to opt-out of error tooltip - #9773

Merged
weronikaolejniczak merged 7 commits into
elastic:mainfrom
Naveen2070:fix-searchbar-tooltip
Jul 2, 2026
Merged

weronikaolejniczak merged 7 commits into
elastic:mainfrom
Naveen2070:fix-searchbar-tooltip

Conversation

@Naveen2070

@Naveen2070 Naveen2070 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

• What: Added an optional showErrorTooltip prop (defaulting to true ) to EuiSearchBar .
• Why: Fixes #9754. Currently, when EuiSearchBar encounters an invalid query, it always renders its internal
error.message inside an EuiToolTip . For consumers (like Kibana) that already render their own custom error UI,
this creates duplicated and overlapping error messages.
• How: Destructured showErrorTooltip in EuiSearchBar and used it to conditionally render the EuiToolTip
wrapper. If false , it simply renders the searchBox without the tooltip.

API Changes

component / parent prop / child change description
EuiSearchBar showErrorTooltip Added Conditionally opt-out of the built-in parse-error tooltip

Screenshots

Before After
Tooltip overlaps with custom Kibana error UI as seen in issue #9754 Tooltip is suppressed, allowing only the consumer's custom error UI to show

Impact Assessment

Note: Most PRs should be tested in Kibana https://github.com/elastic/eui/blob/main/wiki/contributing-to-
eui/testing/testing-in-kibana.md to help gauge their Impact before merging.
[ ] 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
[ ] 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
[✓] 🧪 Test impact — Added unit tests in search_bar.test.tsx using userEvent to verify the tooltip is
suppressed when showErrorTooltip={false} , and that aria-invalid is properly asserted.
[ ] 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them
here.
Impact level: 🟢 Low

Release Readiness

[✓] Documentation: Auto-generated via react-docgen from the new TSDoc comment in search_bar.tsx , and added a
new "Validation error" section to search-bar.mdx explaining accessibility requirements when opting out.
[ ] Figma:
[ ] Migration guide:
[ ] Adoption plan (new features):

QA instructions for reviewer

• Open the EuiSearchBar component in the documentation/playground.
[ ] Confirm that by default, entering an invalid EQL query (e.g., status: ) still shows the built-in error
tooltip.
[ ] Pass showErrorTooltip={false} to the component.
[ ] Enter an invalid EQL query and confirm the search box turns red (error state) but the tooltip does not appear.

Checklist before marking Ready for Review

[✓] Filled out all sections above
[ ] QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader
(N/A - logic change only)
[ ] QA: Tested in CodeSandbox and Kibana
[✓] QA: Tested docs changes (Auto-generated via TSDoc and manual MDX updates)
[✓] Tests: Added/updated Jest
[✓] Changelog: Added changelog entry to changelogs/upcoming/
[ ] Breaking changes: Added breaking change label (if applicable)

Reviewer checklist

[ ] Approved Impact Assessment — Acceptable to merge given the consumer impact.
[ ] Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@Naveen2070
Naveen2070 requested a review from a team as a code owner July 1, 2026 10:12
@cla-checker-service

cla-checker-service Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

💚 CLA has been signed

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@github-actions github-actions Bot added the community contribution (Don't delete - used for automation) label Jul 1, 2026
@weronikaolejniczak

Copy link
Copy Markdown
Contributor

buildkite test this

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-out to EuiSearchBar’s built-in invalid-query tooltip so consumers that already render their own parse error UI (e.g., Kibana) don’t end up with duplicated/overlapping error messaging.

Changes:

  • Added isInvalidTooltipDisabled?: boolean prop to EuiSearchBar.
  • Conditionally skips the EuiToolTip wrapper around the search box when the prop is true.
  • Added a Jest test + upcoming changelog entry for the new behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/eui/src/components/search_bar/search_bar.tsx Adds the new prop and conditionally renders the tooltip wrapper
packages/eui/src/components/search_bar/search_bar.test.tsx Adds coverage for disabling the invalid-query tooltip
packages/eui/changelogs/upcoming/9754.md Documents the new opt-out prop in the upcoming changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euisuperdatepicker (2 differences)

StoryBeforeAfterDiff
custom time zone display desktop
quick select only desktop

@weronikaolejniczak weronikaolejniczak added skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR labels Jul 1, 2026
@Naveen2070 Naveen2070 changed the title feat(search_bar): Add isInvalidTooltipDisabled prop to opt-out of error tooltip (#9754) feat(search_bar): Add isInvalidTooltipDisabled prop to opt-out of error tooltip Jul 1, 2026
@weronikaolejniczak

Copy link
Copy Markdown
Contributor

buildkite test this

@Naveen2070

Naveen2070 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Sorry, but can you run the buildkite just one more time. 😅

@weronikaolejniczak

Copy link
Copy Markdown
Contributor

buildkite test this

@weronikaolejniczak

Copy link
Copy Markdown
Contributor

@Naveen2070 tests are timing out and there are formatting issues in the test file, have you ran them locally and made sure they pass?

It's absolutely fine to use LLM but you are responsible for the PR, so please make sure you validate its output before pushing 🙏🏻 Run the tests, verify they pass, that everything is formatted correctly and run the documentation website, make sure the section looks as expected! We make it easy by building and deploying Storybook for every open PR, linking in a PR comment. Unverified output means back-and-forth that we'd both rather avoid and checking it yourself first would save us both time! 😄

Screenshot 2026-07-01 at 17 15 37

(there's no validation error here and EuiFormRow usage is incorrect)

Screenshot 2026-07-01 at 17 20 43

status: is not an incorrect query and schema is semantically pointless here, just adds noise to the example. We are also missing the very thing that would make this accessible: 'aria-describedby': error ? errorId : undefined. But we'd need to make EuiSearchBar extend the aria-describedby when passing it to EuiSearchBox instead of it overriding whatever comes from box.

@Naveen2070

Naveen2070 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor Author

You're right 😅 — I pushed without properly checking it.

Fixed now:

  • Test now queries role="tooltip" instead of .euiToolTipAnchor, and I fixed the act() warnings that were causing the failures/timeouts.
  • Docs example dropped EuiFormRow (it doesn't forward aria-describedby/id down to EuiSearchBar's input, so it was a no-op), dropped the pointless schema, and now uses a query that actually fails to parse. Also wired aria-describedby to a real error message id, and updated EuiSearchBar to merge that with the hint's id instead of overriding it.
  • Verified locally: full search_bar.test.tsx suite passes, tsc/prettier/lint clean.

@Naveen2070

Copy link
Copy Markdown
Contributor Author

@weronikaolejniczak Can you initiate the buildkite one more time

@weronikaolejniczak

Copy link
Copy Markdown
Contributor

@Naveen2070 there's a conflict because we've just merged a PR in the search bar. Could you take a look? 🙏🏻 Thank you for addressing my concerns.

@weronikaolejniczak weronikaolejniczak removed the ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR label Jul 2, 2026
Naveen2070 and others added 6 commits July 2, 2026 16:35
- Use `queryByRole('tooltip')` and `fireEvent.mouseOver` for reliable tooltip tests
- Wrap `userEvent.type` in `act()` to eliminate test warnings/timeouts
- Merge consumer `aria-describedby` with the hint id instead of overriding it
- Simplify the validation error docs example and correctly wire `aria-describedby` to the rendered error message
…nition

Address PR review feedback: swap fireEvent.mouseOver for userEvent.hover
in tooltip tests, and move the showErrorTooltip accessibility guidance
into an accessibility admonition block.
@Naveen2070
Naveen2070 force-pushed the fix-searchbar-tooltip branch from ffbc6b5 to 74b93df Compare July 2, 2026 11:50
@Naveen2070

Copy link
Copy Markdown
Contributor Author

Rebased the branch onto the latest main to resolve the conflict—hope that's OK! Also addressed both review comments (userEvent.hover swap + :::accessibility admonition).

Address PR review feedback for a lighter-weight error message component
in the accessibility example.
@Naveen2070

Naveen2070 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you so much for being so patient with me! 🙏 I've made the latest change to use EuiFormErrorText directly.

Also, sorry for all the extra iterations 😅 I'm still pretty new to open-source/community contributions, and I should've double-checked things more carefully before pushing. I'll definitely be more mindful of that going forward.

Really appreciate all your guidance and reviews. Looking forward to contributing more.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything works as I'd expect it to now! 🟢 Thank you for contributing, @Naveen2070 🙏🏻

And it's absolutely okay, we're all learning. The best advice I can give for being en engineer in these LLM-powered times is don't offload your critical thinking to LLM. You are the driver and you are the one responsible for the result. Always double-check is up to best standards. If there's anything you are unsure about, you can always ask the maintainers.

As for everything else, like using EuiFormErrorText and not EuiCallOut, these things are expected because you're not familiar with our codebase. That'll come with time ;)

Screenshot 2026-07-02 at 16 17 14

@weronikaolejniczak
weronikaolejniczak merged commit 258a346 into elastic:main Jul 2, 2026
1 check passed
mgadewoll added a commit to elastic/kibana that referenced this pull request Jul 17, 2026
## Dependency updates

`@elastic/eui` - v116.5.0 ⏩ v117.0.0

## Changes

- removes temporary custom styles in
`src/core/packages/notifications/browser-internal/src/toasts/global_toast_list.tsx`
(added previously in #273985)
- removes custom icon usages passed via `children` on `EuiCallOut` to
prevent duplication (callouts now have internal default icons per type)
- updates tests and snapshots due to `EuiCallOut` changes

## Package updates

### `@elastic/eui`
[`v117.0.0`](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added `EuiIllustration` for rendering SVG illustrations (e.g. from
`@elastic/eui-illustrations`) that respond to the active EUI color mode
([#9779](elastic/eui#9779))
- Added `compressed` prop to `EuiSearchBar` to enable compact display
mode for the search box and filter buttons
([#9743](elastic/eui#9743))
- Added `addToChat` glyph to `EuiIcon`
([#9768](elastic/eui#9768))
- Updated `EuiCallOut`:
([#9642](elastic/eui#9642))
    - Updated component styles
- Added `text` prop on `EuiCallOut` which renders the main, inline
callout description text - use this instead of `children` where possible
- Added `actionProps` prop on `EuiCallOut` which renders primary and
secondary action buttons
- Added `showErrorTooltip` (defaulting to `true`) to `EuiSearchBar` to
allow consumers to opt-out of the built-in parse-error tooltip
([#9773](elastic/eui#9773))

**Bug fixes**

- Fixed `EuiToast` cutting off absolute positioned content by removing
`overflow: hidden`. ([#9791](elastic/eui#9791))
- Fixed `EuiFlyout` container-scoped flyouts shrinking below usable
widths for named sizes `s` and `m` by applying minimum width floors
derived from theme breakpoints
([#9787](elastic/eui#9787))
- Fixed `EuiSelectable` with group labels rendering options with stale
heights ([#9770](elastic/eui#9770))

**Breaking changes**

- Removed the `accent` variant for `color` on `EuiCallOut`
([#9642](elastic/eui#9642))
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request Aug 5, 2026
## Dependency updates

`@elastic/eui` - v116.5.0 ⏩ v117.0.0

## Changes

- removes temporary custom styles in
`src/core/packages/notifications/browser-internal/src/toasts/global_toast_list.tsx`
(added previously in elastic#273985)
- removes custom icon usages passed via `children` on `EuiCallOut` to
prevent duplication (callouts now have internal default icons per type)
- updates tests and snapshots due to `EuiCallOut` changes

## Package updates

### `@elastic/eui`
[`v117.0.0`](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added `EuiIllustration` for rendering SVG illustrations (e.g. from
`@elastic/eui-illustrations`) that respond to the active EUI color mode
([elastic#9779](elastic/eui#9779))
- Added `compressed` prop to `EuiSearchBar` to enable compact display
mode for the search box and filter buttons
([elastic#9743](elastic/eui#9743))
- Added `addToChat` glyph to `EuiIcon`
([elastic#9768](elastic/eui#9768))
- Updated `EuiCallOut`:
([elastic#9642](elastic/eui#9642))
    - Updated component styles
- Added `text` prop on `EuiCallOut` which renders the main, inline
callout description text - use this instead of `children` where possible
- Added `actionProps` prop on `EuiCallOut` which renders primary and
secondary action buttons
- Added `showErrorTooltip` (defaulting to `true`) to `EuiSearchBar` to
allow consumers to opt-out of the built-in parse-error tooltip
([elastic#9773](elastic/eui#9773))

**Bug fixes**

- Fixed `EuiToast` cutting off absolute positioned content by removing
`overflow: hidden`. ([elastic#9791](elastic/eui#9791))
- Fixed `EuiFlyout` container-scoped flyouts shrinking below usable
widths for named sizes `s` and `m` by applying minimum width floors
derived from theme breakpoints
([elastic#9787](elastic/eui#9787))
- Fixed `EuiSelectable` with group labels rendering options with stale
heights ([elastic#9770](elastic/eui#9770))

**Breaking changes**

- Removed the `accent` variant for `color` on `EuiCallOut`
([elastic#9642](elastic/eui#9642))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution (Don't delete - used for automation) skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiSearchBar] Conditional error tooltip

3 participants