From 415971dc415109a8dc08c503cb0703dfcd893ae2 Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Thu, 7 Mar 2024 08:38:37 -0800 Subject: [PATCH] [EuiBreadcrumb] Allow popover content to close the breadcrumb popover (#7555) --- changelogs/upcoming/7555.md | 1 + .../views/breadcrumbs/breadcrumbs_example.js | 8 +++ .../src/views/breadcrumbs/popover_content.tsx | 59 +++++++++---------- .../__snapshots__/breadcrumb.test.tsx.snap | 2 +- .../breadcrumbs/breadcrumb.test.tsx | 57 +++++++++++++----- src/components/breadcrumbs/breadcrumb.tsx | 13 ++-- 6 files changed, 89 insertions(+), 51 deletions(-) create mode 100644 changelogs/upcoming/7555.md diff --git a/changelogs/upcoming/7555.md b/changelogs/upcoming/7555.md new file mode 100644 index 00000000000..b827da815c6 --- /dev/null +++ b/changelogs/upcoming/7555.md @@ -0,0 +1 @@ +- `EuiBreadcrumbs`'s `popoverContent` API now accepts a render function that will be passed a `closePopover` callback, allowing consumers to close the breadcrumb popover from their popover content diff --git a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js index 9d3ec472d66..53fe2dd0d9e 100644 --- a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js +++ b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js @@ -294,6 +294,14 @@ export const BreadcrumbsExample = { accepted as they are controlled automatically by{' '} EuiBreadcrumbs.
+
+ If you need the ability to close the breadcrumb popover from within
+ your popover content,