-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Send button is active when message has spaces, but does not send it #8064
Conversation
re-create from #8036 (comment) |
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.
@NikkiWines LGTM!
Commenting since I can't edit the PR PR Reviewer Checklist
|
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.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @NikkiWines in version: 1.1.42-0 🚀
|
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
isCommentEmpty: newComment.length === 0, | ||
isCommentEmpty: newComment.trim().length === 0, |
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.
This caused a regression #21920. We used to relay on isCommentEmpty
state being actually empty (length is 0) to move on to edit mode. This change made it possible to go into edit mode while having content on the Composer.
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.
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.
Sure! The edit mode was accessible based on isCommentEmpty
state. Before if the composer only contains empty spaces
and you keep pressing the arrow up key, nothing will happen because the comment is not empty. But now the comment length is based on the trimmed version of that text so the composer appears empty and pressing the arrow up will get you into edit mode.
Details
this.updateComment(this.comment);
tocomponentDidMount
so thecomment
state will be check and update theisCommentEmpty
state, if empty the button will be disable after the page loadtrim()
everytimeupdateComment()
called and removes whitespace from both sides stringsthis.textInput.selectionStart === 0
only to show trigger box edit if cursor position at start positionFixed Issues
$ #7965
Tests
PR Review Checklist
Contributor (PR Author) Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)Styling.md
) for all style edits I madeSTYLE.md
)Avatar
, I verified the components usingAvatar
are working as expected)main
branch)PR Reviewer Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)main
branch)QA Steps
Screenshots
Web
Screen.Recording.2022-03-08.at.08.33.59.mov
Mobile Web
Screen.Recording.2022-03-08.at.08.45.13.mov
Desktop
Screen.Recording.2022-03-08.at.08.35.03.mov
Screen.Recording.2022-03-08.at.15.59.52.mov
iOS
Screen.Recording.2022-03-08.at.08.41.51.mov
Android
Screen.Recording.2022-03-08.at.15.37.50.mov