Skip to content

[EuiConfirmModal] Title should be wrapped in an HTML heading if provided as a string #5276

Closed

Description

@1Copenut

Steps to reproduce

  1. Open Kibana instance
  2. Open a modal like the screenshots below
  3. Evaluate with Dev Tools and verify there is text that is styled like a heading, but is semantically a simple DIV

Discard changes to dashboard modal


Clone dashboard modal


Create new tag modal

Actual Result

  • The modals have heading text that has a visual hierarchy that does not match its semantic hierarchy. Text that looks like a heading must be marked up as a heading to convey that importance to all users.

Expected Result

  • Text keeps the current styling, but is marked up as an H2

Kibana Version:
v8.0.0

OS:
MacOS Big Sur

Browser:
Chrome

Relevant WCAG Criteria: Understanding Success Criterion 1.3.1: Info and Relationships - Level A

Activity

  1. elasticmachine commented on Oct 7, 2021

    @elasticmachine
    Collaborator

    Pinging @elastic/kibana-accessibility (Project:Accessibility)

  2. changed the title [-][COGNITION]: [/-] [+][COGNITION]: Text that appears like a heading must be marked up as a heading[/+] on Oct 7, 2021
  3. elasticmachine commented on Oct 15, 2021

    @elasticmachine
    Collaborator

    Pinging @elastic/kibana-design (Team:Kibana-Design)

  4. kertal commented on Oct 15, 2021

    @kertal
    Member

    This can't be changed in Kibana , it should be moved to EUI

  5. transferred this issue fromelastic/kibanaon Oct 15, 2021
  6. 1Copenut commented on Oct 15, 2021

    @1Copenut
    ContributorAuthor

    Thanks for the followup @kertal. I moved this to EUI and have re-tagged it.

  7. cchaos commented on Oct 25, 2021

    @cchaos
    Contributor

    @1Copenut The EuiModal component doesn't create the heading level directly. All of our docs examples shows wrapping the title text in an <h1> like so:

    <EuiModalHeaderTitle>
      <h1>Modal title</h1>
    </EuiModalHeaderTitle>
    

    The statement that was made:

    This can't be changed in Kibana , it should be moved to EUI

    Is actually false, as all they need to do is wrap their title text in a HTML heading.

  8. cchaos commented on Oct 25, 2021

    @cchaos
    Contributor

    If we need to, in the EUI docs, we can add a strong callout identifying this aspect. But it would be a truly harsh update to those who were copying the examples properly to have to unwrap all their text.

  9. cchaos commented on Oct 25, 2021

    @cchaos
    Contributor

    I spoke somewhat too harshly too soon, it does look like our EuiConfirmModal specifically doesn't wrap the title if it's simply provided as a string. I've updated the title of the issue to reflect this.

    Screen Shot 2021-10-25 at 15 22 06 PM

  10. changed the title [-][COGNITION]: Text that appears like a heading must be marked up as a heading[/-] [+][EuiConfirmModal] Title should be wrapped in an HTML heading if provided as a `string`[/+] on Oct 25, 2021
  11. self-assigned this
    on Dec 20, 2021
  12. 1Copenut commented on Jan 10, 2022

    @1Copenut
    ContributorAuthor

    @kertal I wanted to follow up on this issue. I made a change to our EUI component to wrap strings in an H1, but I'm still seeing DIV containers in Kibana 8 on the main branch locally. If consumers are passing in a legitimate React element, the component will not override it with a heading. Is there additional action Kibana teams can make, or does this issue have a longer tail than we first thought?

  13. cee-chen commented on Jan 10, 2022

    @cee-chen
    Contributor

    I made a change to our EUI component to wrap strings in an H1, but I'm still seeing DIV containers in Kibana 8 on the main branch locally

    @1Copenut your fix isn't yet in Kibana - the upgrade PR is still open (elastic/kibana#122386). I would wait until that PR lands to check the main branch, or check that branch directly

  14. 1Copenut commented on Jan 10, 2022

    @1Copenut
    ContributorAuthor

    Thank you @constancecchen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions