Skip to content

Legend sizing does not account for scrollbar width #1011

@nickofthyme

Description

@nickofthyme

Describe the bug
The Right or Left legend positions do not account for the browser scrollbar. Particularly, with short legend names.

Only on Chrome and Safari, not FireFox.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://elastic.github.io/elastic-charts/?path=/story/small-multiples-alpha--grid-lines&knob-Show Legend=true
  2. Toggle the legend with the provided knob
  3. Notice the legend item labels are truncated due to the scroll bar.

Expected behavior
Somehow account for the scrollbar width when legend values exceed the height of the legend container.

Screenshots
Screen Recording 2021-02-03 at 09 35 AM

When the legend container is set to overflow-x: hidden the issue goes away

image

Kibana Cross Issues
elastic/kibana#94596

Metadata

Metadata

Assignees

Labels

:legendLegend related issuebugSomething isn't workingreleasedIssue released publicly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions