Skip to content

Conversation

scottander
Copy link
Contributor

In order to maintain compatibility with multiple windows, it is optimal to not use the window or document global in most cases.
I have done some cleanup where I believe the usage of these globals was not correct.

I was hoping that since the scope of these changes was fairly minor that i would encapsulate them in one PR.

@mui-pr-bot
Copy link

mui-pr-bot commented Aug 11, 2020

@material-ui/core: parsed: +0.09% , gzip: +0.08%

Details of bundle changes

Generated by 🚫 dangerJS against 3da610f

@@ -151,7 +151,7 @@ const ButtonBase = React.forwardRef(function ButtonBase(props, ref) {
'stop',
(event) => {
if (focusVisible) {
onBlurVisible(event);
onBlurVisible();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently not needed but will be in the future with React 17. onBlurVisible already has a notice so this shouldn't be changed.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far. Great suggestions. Though this should be targetted at next and needs a yarn prettier.

@eps1lon eps1lon changed the title Document and Window global cleanup [core] Fix various potential issues with multiple windows Aug 11, 2020
@scottander scottander changed the base branch from master to next August 12, 2020 14:48
@eps1lon eps1lon removed the request for review from dimitropoulos August 12, 2020 15:15
@scottander
Copy link
Contributor Author

Thanks @eps1lon, I have hopefully have addressed your feedback.

@oliviertassinari oliviertassinari added the type: bug It doesn't behave as expected. label Aug 12, 2020
@eps1lon eps1lon merged commit 41aa4bd into mui:next Aug 13, 2020
@eps1lon
Copy link
Member

eps1lon commented Aug 13, 2020

@scottander Great work, thanks!

@oliviertassinari oliviertassinari added the internal Behind-the-scenes enhancement. Formerly called “core”. label Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Behind-the-scenes enhancement. Formerly called “core”. type: bug It doesn't behave as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants