Skip to content

[Backdrop] component prop doesn't have an effect #46264

Closed
@joelvdavies

Description

@joelvdavies

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/github-yz9jia8s?file=src%2FApp.tsx
  2. Inspect the rendered backdrop element to see it is still using a div

Current behavior

The component remains a div, even when component="span" or other element types are supplied.

Expected behavior

The backdrop component should use the specified element type. It seems slots={{ root: 'span' }} works correctly in the way I would expect the component prop to.

Context

In our case we were using this inside a table component and to maintain a valid table structure we wanted it to render it as a "tr" component. I believe this is the same as #44283, only that was closed as it lacked an example.

Your environment

We use MUI v6 currently, but the above example demonstrates it on the latest MUI v7 version.

Search keywords: backdrop component prop

Metadata

Metadata

Assignees

Labels

component: backdropThis is the name of the generic UI component, not the React module!regression 🐛A bug, but worse

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions