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

[TextareaAutoSize] ignore extra renders to cause infinite loop which crashes IE #17682

Closed

Conversation

adeelibr
Copy link
Contributor

@adeelibr adeelibr commented Oct 3, 2019

Closes issue #17672 & also closes #17655

Help taken from this issue comment #16685 (comment)

@mui-pr-bot
Copy link

Details of bundle changes.

Comparing: ad2a4f7...017bc5c

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core +0.02% 🔺 +0.03% 🔺 334,818 334,889 91,342 91,365
@material-ui/core/Paper 0.00% 0.00% 69,248 69,248 20,556 20,556
@material-ui/core/Paper.esm 0.00% 0.00% 62,520 62,520 19,303 19,303
@material-ui/core/Popper 0.00% 0.00% 28,405 28,405 10,179 10,179
@material-ui/core/Textarea +1.39% 🔺 +1.26% 🔺 5,106 5,177 2,149 2,176
@material-ui/core/TrapFocus 0.00% 0.00% 3,766 3,766 1,597 1,597
@material-ui/core/styles/createMuiTheme 0.00% 0.00% 16,351 16,351 5,819 5,819
@material-ui/core/useMediaQuery 0.00% 0.00% 2,488 2,488 1,050 1,050
@material-ui/lab 0.00% 0.00% 143,407 143,407 43,822 43,822
@material-ui/styles 0.00% 0.00% 51,780 51,780 15,359 15,359
@material-ui/system 0.00% 0.00% 15,586 15,586 4,344 4,344
Button 0.00% 0.00% 79,690 79,690 24,259 24,259
Modal 0.00% 0.00% 14,542 14,542 5,114 5,114
Portal 0.00% 0.00% 2,907 2,907 1,316 1,316
Rating 0.00% 0.00% 70,240 70,240 21,944 21,944
Slider 0.00% 0.00% 75,381 75,381 23,270 23,270
colorManipulator 0.00% 0.00% 3,835 3,835 1,519 1,519
docs.landing 0.00% 0.00% 54,267 54,267 14,346 14,346
docs.main 0.00% 0.00% 599,261 599,261 191,016 191,016
packages/material-ui/build/umd/material-ui.production.min.js +0.02% 🔺 +0.02% 🔺 305,709 305,778 87,933 87,947

Generated by 🚫 dangerJS against 017bc5c

@oliviertassinari
Copy link
Member

@adeelibr Sorry, my proposal wasn't meant to be the final solution. It doesn't work.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 3, 2019

@adeelibr Of course, if you have another fix proposal, we would be happy to hear, first, I think that it would be great to review why it doesn't work. Thanks for taking the time to open a PR.

@adeelibr
Copy link
Contributor Author

adeelibr commented Oct 3, 2019

I will look into this issue more, and get back to you.

@adeelibr
Copy link
Contributor Author

adeelibr commented Oct 3, 2019

Adding `syncHeight` in the dependency array for `useEnhancedEffect` seems to solve the problem.
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;

& Line. 110

 useEnhancedEffect(() => {
  syncHeight();
+ }, [syncHeight]);

Does this seem like an acceptable solution? @oliviertassinari

@adeelibr adeelibr deleted the textareaautosize-infinite-loop-ie-crash branch October 13, 2019 22:04
@zannager zannager added the component: TextareaAutosize The React component. label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TextareaAutosize The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Textarea Autosize Demo: Maximum update depth exceeded
4 participants