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

fix(forms): prevent Textarea autosize infinite loop #1676

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

jzempel
Copy link
Member

@jzempel jzempel commented Jan 19, 2024

Description

This PR removes a useEffect that puts a React 18, controlled, autosized (with minRows & maxRows defined) Textarea into an infinite loop after the window has been resized. Testing shows that the existing useLayoutEffect is sufficient for handling both controlled and uncontrolled component resizing.

Detail

closes #1563

@jzempel jzempel requested a review from a team as a code owner January 19, 2024 20:03
@coveralls
Copy link

Coverage Status

coverage: 96.234% (+0.002%) from 96.232%
when pulling f0d843b on jzempel/fix-textarea
into f9072ca on main.

Copy link
Contributor

@smritimadan smritimadan left a comment

Choose a reason for hiding this comment

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

👍

@jzempel jzempel merged commit c12510f into main Jan 19, 2024
6 checks passed
@jzempel jzempel deleted the jzempel/fix-textarea branch January 19, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Maximum update depth exceeded with textarea component
4 participants