Skip to content

[Dialog] Flatten DialogTitle DOM structure #19696

@eps1lon

Description

@eps1lon

Summary 💡

DialogTitle should be flatter

Examples 🌈

Motivation 🔦

  • Aligning items of the title
    <DialogTitle style={ display: 'flex', alignItems: 'center' }>
      <SomeIcon />
      My Title
    </DialogTitle>
  • fewer DOM elements -> fewer brittle element selectors

It is possible but requires targetting nested elements. disableTypography is not helpful since then we wouldn't render a heading element.

We could leverage aria but this would go against rule 1 of aria (don't use aria): <DialogTitle disableTypography role="heading" aria-level="2" className={variantH2Styles} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeIntroduces changes that are not backward compatible.priority: importantThis change can make a difference.scope: dialogChanges related to the dialog.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions