feat(legend): add legendActionOnHover option to show actions on hover#2773
feat(legend): add legendActionOnHover option to show actions on hover#2773maryam-saeidi merged 22 commits intoelastic:mainfrom
Conversation
packages/charts/src/components/legend/legend_table/legend_table_item.tsx
Outdated
Show resolved
Hide resolved
|
@markov00 In the current implementation, when moving between cells with keyboard, the action remains visible afterwards as seen below (when clicked, only that action will be visible): Screen.Recording.2026-01-21.at.14.53.14.movI tried briefly to see if I can make keyboard experience similar to click with mouse, but there are so many edge cases and I didn't find a straightforward way to do so. I think the current implementation is good enough for the keyboard scenario, wdyt? |
|
buildkite update vrt |
|
buildkite build this |
|
We're in the process of migrating the build pipeline of this repo to an elastic-wide from the custom one we had before, this PR might require an admin-merge when deemed ready because some checks seem to be stuck. |
packages/charts/src/components/legend/legend_table/legend_table_item.tsx
Outdated
Show resolved
Hide resolved
packages/charts/src/components/legend/use_action_focus_management.ts
Outdated
Show resolved
Hide resolved
markov00
left a comment
There was a problem hiding this comment.
LGTM thanks for all the changes and cleanups.
I've also changed the title to feat instead of fix to better align with the actual content of this PR.
Please verify during the merge that the commit title reflect correctly the changed title.
# [71.2.0](v71.1.2...v71.2.0) (2026-02-26) ### Bug Fixes * **metric:** update badge to pill shape with adjusted padding ([#2786](#2786)) ([80be269](80be269)) * **theme:** expose font weight in text style ([#2788](#2788)) ([02f4afa](02f4afa)) ### Features * **legend:** add "list" layout for horizontal legends ([#2784](#2784)) ([8967ce3](8967ce3)) * **legend:** add legendActionOnHover option to show actions on hover ([#2773](#2773)) ([d1be88f](d1be88f))
## Summary This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@elastic/charts](https://togithub.com/elastic/elastic-charts) | dependencies | minor | [`71.1.2` -> `71.2.0`](elastic/elastic-charts@v71.1.2...v71.2.0) | --- ### Release Notes ## [71.2.0](elastic/elastic-charts@v71.1.2...v71.2.0) (2026-02-26) ### Bug Fixes * **metric:** update badge to pill shape with adjusted padding ([#2786](elastic/elastic-charts#2786)) ([80be269](elastic/elastic-charts@80be269)) * **theme:** expose font weight in text style ([#2788](elastic/elastic-charts#2788)) ([02f4afa](elastic/elastic-charts@02f4afa)) ### Features * **legend:** add "list" layout for horizontal legends ([#2784](elastic/elastic-charts#2784)) ([8967ce3](elastic/elastic-charts@8967ce3)) * **legend:** add legendActionOnHover option to show actions on hover ([#2773](elastic/elastic-charts#2773)) ([d1be88f](elastic/elastic-charts@d1be88f))
## Summary This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@elastic/charts](https://togithub.com/elastic/elastic-charts) | dependencies | minor | [`71.1.2` -> `71.2.0`](elastic/elastic-charts@v71.1.2...v71.2.0) | --- ### Release Notes ## [71.2.0](elastic/elastic-charts@v71.1.2...v71.2.0) (2026-02-26) ### Bug Fixes * **metric:** update badge to pill shape with adjusted padding ([elastic#2786](elastic/elastic-charts#2786)) ([80be269](elastic/elastic-charts@80be269)) * **theme:** expose font weight in text style ([elastic#2788](elastic/elastic-charts#2788)) ([02f4afa](elastic/elastic-charts@02f4afa)) ### Features * **legend:** add "list" layout for horizontal legends ([elastic#2784](elastic/elastic-charts#2784)) ([8967ce3](elastic/elastic-charts@8967ce3)) * **legend:** add legendActionOnHover option to show actions on hover ([elastic#2773](elastic/elastic-charts#2773)) ([d1be88f](elastic/elastic-charts@d1be88f))
Summary
The legendActionOnHover prop is now available in the Settings component to control when legend action icons are displayed. When set to true, legend actions (like filter buttons) are hidden by default and only appear when hovering over a legend item, providing a cleaner and less cluttered legend appearance. The action remains visible while interacting with it and supports full keyboard accessibility.
Screen.Recording.2026-01-29.at.17.06.14.mov
Example usage
Details
Issues
Closes #2444
Checklist
:interactions,:axis)closes #123,fixes #123)🤖 This pull request was assisted by Cursor