Skip to content
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

fix(legend): disable handleLabelClick for one legend item #1134

Merged
merged 15 commits into from
Apr 26, 2021

Conversation

rshen91
Copy link
Contributor

@rshen91 rshen91 commented Apr 22, 2021

Summary

Fixes #1055

If there is only one legend item, the label will not be able to be clicked to be visible or not. That functionality still works for charts with multiple legend items.

Checklist

Delete any items that are not applicable to this PR.

  • Unit tests were updated or added to match the most common scenarios

@rshen91 rshen91 added :legend Legend related issue :interactions Interactions related issue labels Apr 22, 2021
@rshen91 rshen91 marked this pull request as ready for review April 22, 2021 21:40
Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Looks like the ItemLabel is still toggleable. We need to update that in addition to the click handler.

Screen Recording 2021-04-22 at 05 27 27 PM

@rshen91
Copy link
Contributor Author

rshen91 commented Apr 23, 2021

Looks like the ItemLabel is still toggleable. We need to update that in addition to the click handler.

Screen Recording 2021-04-22 at 05 27 27 PM

ah good catch - please see a34bf4a thank you!

@rshen91 rshen91 changed the title feat(legend): disable handleLabelClick for one legend item fix(legend): disable handleLabelClick for one legend item Apr 23, 2021
integration/tests/accessibility.test.ts Outdated Show resolved Hide resolved
integration/tests/legend_stories.test.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor comments

src/components/legend/legend.test.tsx Show resolved Hide resolved
src/components/legend/legend.test.tsx Outdated Show resolved Hide resolved
src/components/legend/legend.test.tsx Outdated Show resolved Hide resolved
@rshen91 rshen91 merged commit a7242af into elastic:master Apr 26, 2021
nickofthyme pushed a commit that referenced this pull request May 25, 2021
# [29.2.0](v29.1.0...v29.2.0) (2021-05-25)

### Bug Fixes

* **legend:** disable handleLabelClick for one legend item ([#1134](#1134)) ([a7242af](a7242af)), closes [#1055](#1055)

### Features

* **a11y:** add alt text for all chart types  ([#1118](#1118)) ([9e42229](9e42229)), closes [#1107](#1107)
* **legend:** specify number of columns on floating legend ([#1159](#1159)) ([c2e4652](c2e4652)), closes [#1158](#1158)
* simple screenspace constraint solver ([#1141](#1141)) ([eb11480](eb11480))
@nickofthyme
Copy link
Collaborator

🎉 This PR is included in version 29.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label May 25, 2021
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:interactions Interactions related issue :legend Legend related issue released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable toggle visiblity behavior on legend items.
2 participants