Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portal: onRendered doesn't make sense if disablePortal is true #16595

Closed
2 tasks done
Zaynex opened this issue Jul 14, 2019 · 1 comment · Fixed by #16597
Closed
2 tasks done

Portal: onRendered doesn't make sense if disablePortal is true #16595

Zaynex opened this issue Jul 14, 2019 · 1 comment · Fixed by #16597
Assignees
Labels
component: Portal The React component. new feature New feature or request

Comments

@Zaynex
Copy link
Contributor

Zaynex commented Jul 14, 2019

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

I'm not sure if it's a design or a bug.
But I think this onRendered method should be allowed to be executed even if Portal is disablePortal. Otherwise, it can't be called a onRendered name(it's not inappropriate).

Current Behavior 😯

Portal: onRendered doesn't make sense if disablePortal is true.

Steps to Reproduce 🕹

Link:https://codesandbox.io/s/material-demo-q46iu

  1. just click the MOUNT CHILDREN
  2. see dev-tools console

The Reason

https://github.com/mui-org/material-ui/blob/783b6934632714a844b7d440e6d05729f9f2dc0c/packages/material-ui/src/Portal/Portal.js#L26

if disablePortal is true, it will not set mountNode.

https://github.com/mui-org/material-ui/blob/783b6934632714a844b7d440e6d05729f9f2dc0c/packages/material-ui/src/Portal/Portal.js#L34
and only if mountNode exist that onRendered function will call.

Your Environment 🌎

Tech Version
Material-UI latest
React latest
Browser chrome
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 14, 2019

@Zaynex We will deprecate onRendered in the future. Your problem should be handled in #16597.

@oliviertassinari oliviertassinari added component: Portal The React component. new feature New feature or request labels Jul 14, 2019
@oliviertassinari oliviertassinari self-assigned this Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Portal The React component. new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants