Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: update textarea to fit content height and set a max height#17946

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaaydenh merged 3 commits intomainfromjaaydenh/textarea-height
May 21, 2025

Conversation

jaaydenh
Copy link
Contributor

No description provided.

@jaaydenhjaaydenh self-assigned thisMay 20, 2025
@jaaydenhjaaydenh requested a review fromaslilacMay 20, 2025 16:59
@jaaydenhjaaydenh changed the titlefix: textarea show fit height of content and set a max heightfix: update textarea to fit content height and set a max heightMay 20, 2025
id={id}
className="max-w-2xl"
className="overflow-y-auto max-h-[500px]"
value={localValue}
onChange={(e) => {
const target = e.currentTarget;
target.style.height = "auto";
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 a static style and should be turned into a tailwind class as well

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

When I test this, If I don't set height to auto in the onchange, the textarea height does not get updated correctly when the users adds and removes lines from the textarea

@jaaydenhjaaydenh requested a review fromaslilacMay 20, 2025 19:28
const resizeTextarea = useEffectEvent(() => {
if (textareaRef.current) {
const textarea = textareaRef.current;
textarea.style.height = "auto";
Copy link
Member

Choose a reason for hiding this comment

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

does this actually do anything? you overwrite it immediately

jaaydenh reacted with thumbs up emoji
Copy link
ContributorAuthor

@jaaydenhjaaydenhMay 20, 2025
edited
Loading

Choose a reason for hiding this comment

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

you are right it was necessary in the onChange below but not needed here.

@jaaydenhjaaydenh merged commit3a6d5f5 intomainMay 21, 2025
33 of 34 checks passed
@jaaydenhjaaydenh deleted the jaaydenh/textarea-height branchMay 21, 2025 14:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees

@jaaydenhjaaydenh

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jaaydenh@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp