-
Notifications
You must be signed in to change notification settings - Fork 66
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 rowsMax bug #1369
Fix rowsMax bug #1369
Conversation
bug caused by function only triggered by a key event
Still flickers if you delete default text and edit again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest we remove targetEl.style.height = 'auto'
from the autoReisze hook as its no longer needed?
@@ -14,13 +14,22 @@ export const useAutoResize = ( | |||
newHeight = Math.max(targetEl.scrollHeight, newHeight) | |||
if (maxHeight) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check necessary as you are already checking it on line 13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
targetEl.style.height = 'auto'
is needed here too, for it to autoresize correctly when user deletes text. It's to rewrite the height
when it's set before.
The nested maxHeight
check is also needed, as you can see its if
parent is !maxHeight || maxHeight > newHeight
, this logic is needed for whenever maxHeight > newHeight
only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvements fixed and tested so ready again for review @mimarz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Resolves #1367