Skip to content

[all components] Support non main document: iframe, popup, etc #629

@oliviertassinari

Description

@oliviertassinari

Steps to reproduce

There are a number of components that are broken when used in non main window context, meaning in iframe, popup, shadow dom. A few quick examples:

  • Dialog

const html = document.documentElement;

  • NumberInput

return ReactDOM.createPortal(renderElement(), document.body);

  • Slider

if (disabled && sliderRef.current!.contains(document.activeElement)) {

Context

A few related issues: mui/material-ui#18701, mui/material-ui#10328.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: all componentsWidespread work has an impact on almost all components.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions