Skip to content

Fix: fix unexpected scroll behavior in textarea #2536

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StrongMonkey
Copy link
Contributor

@StrongMonkey StrongMonkey requested a review from ivyjeong13 April 15, 2025 00:26
}
};
}

function findScrollContainer(el: HTMLElement): HTMLElement | null {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this is unnecessary? I think we should be using this action on a textarea and setting that with a scroll overflowY if we're using autoHeight

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the problem here is that the parent div is scrollable, not the textarea. I tried to set on textarea and it didn't work.

export function autoHeight(node: HTMLTextAreaElement) {
const scrollContainer = findScrollContainer(node);
Copy link
Contributor

Choose a reason for hiding this comment

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

Screen.Recording.2025-04-15.at.10.20.06.AM.mov

Looks like it turns the text area into a crazy long height for me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, can't see your video. but the height looks fine to me?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, can't see your video. but the height looks fine to me?

image

Oh oops, sorry! Didn't realize the video isn't working, here's a Loom!

https://www.loom.com/share/f94268d7ccf24c6a941366b928a02296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants