Skip to content

[Dashboard] Missing panel title h2 style #239708

@markov00

Description

@markov00

Kibana version:
8.x, 9.x

Describe the bug:

An h2 element is wrapping the panel title when the panel has a description, when not it just uses the panelTitleElement.

{!hideTitle ? (
<h2
// styles necessary for applying ellipsis and showing the info icon if description is present
css={css`
overflow: hidden;
`}
>
<EuiScreenReaderOnly>
<span id={headerId}>
{panelTitle
? i18n.translate('presentationPanel.ariaLabel', {
defaultMessage: 'Panel: {title}',
values: {
title: panelTitle,
},
})
: i18n.translate('presentationPanel.untitledPanelAriaLabel', {
defaultMessage: 'Untitled panel',
})}
</span>
</EuiScreenReaderOnly>
{panelTitleElement}
</h2>
) : null}

This h2 doesn't own its style, but is inherited. Unfortunately a style override (from a browser extensions for example) at the body/html level could wrongly updates the font-size of this header causing the title to be larger then the required size.
EUI doesn't block this behaviour and the h2 is not styled to prevent that.

Steps to reproduce:

  1. create a dashboard with two panels, one with just the title, the other with title and description
  2. add a custom h2 style with font-size: 40px or more
  3. you will notice that the panel with description increases in font-size.

Expected behavior:
It should behave as every other h2 elements aka EuiTitles and it should not be overwritten by custom styles.

Also the other wrong fact is that it has semantically a different meaning then the title without the description that is just a link or a span if in read-only mode.

Screenshots (if relevant):

Image

Metadata

Metadata

Assignees

Labels

Feature:DashboardDashboard related featuresTeam:PresentationPresentation Team for Dashboard, Input Controls, and Canvas t//bugFixes for quality problems that affect the customer experiencegood first issuelow hanging fruitimpact:lowAddressing this issue will have a low level of impact on the quality/strength of our product.loe:smallSmall Level of Effort

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