You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PAID] [$500] Web - Composer send button is enabled even when the input contains only space #26433
Type multiple spaces and verify the send button is still disabled
Close the chat or navigate to another chat
Open back the chat
Expected Result:
The send button stays disabled because it contains only space
Actual Result:
The send button is enabled
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.60.1 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
What changes do you think we should make in order to solve the problem?
This issue happens after the ReportActionCompose refactor. Previously, when the composer mounted, we always called updateComment to make sure isCommentEmpty had a correct value, but this approach raised this issue.
Even though the issue is marked as not a bug, I still think it's a bug and we shouldn't use the old approach which is a workaround. To fully solve the issue, we should replace _.isEmpty with the regex we use when typing in the composer.
isCommentEmpty: {
selector: (comment) => !comment || !!comment.match(/^(\s)*$/)
// comment could be undefined, so we also use !comment
What changes do you think we should make in order to solve the problem?
We can trim the comment and then update isCommentEmpty. By this, it will remove the start and ending spaces of text, and then make the button enabled and disabled based on that.
📣 @alifhaider! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
changed the title [-]Web - Composer send button is enabled even when the input contains only space[/-][+][$500] Web - Composer send button is enabled even when the input contains only space[/+]on Sep 1, 2023
@bernhardoj - You've been paid in Upwork. I left a note on the bonus payment but I thought we had two separate contracts for this job for you so I added the bonus to pay the reporting payment after the fact. Let me know if you have any questions.
@fedirjh - I'll keep my eyes open for an update on the checklist and move forward once there's one.
changed the title [-][HOLD for payment 2023-10-05] [$500] Web - Composer send button is enabled even when the input contains only space[/-][+][PAID] [$500] Web - Composer send button is enabled even when the input contains only space[/+]on Oct 9, 2023
Activity
melvin-bot commentedon Aug 31, 2023
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 31, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)kbecciv commentedon Aug 31, 2023
Proposal by: @bernhardoj
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693037242762969
Proposal
Please re-state the problem that we are trying to solve in this issue.
The composer send button is enabled even when it contains only space.
What is the root cause of that problem?
We disable the send button if
isCommentEmptystate is true. The initial value ofisCommentEmptycomes fromisCommentEmptyProp.App/src/pages/home/report/ReportActionCompose/ReportActionCompose.js
Line 131 in c169952
https://github.com/Expensify/App/blob/c16995257c738761206ea07645e863ee717ecbc0/src/pages/home/report/ReportActionCompose/ReportActionCompose.js#[…]8
Notice that we check using _.isEmpty which considers space only as not empty. This is different from what we do when typing something in the composer.
https://github.com/Expensify/App/blob/c16995257c738761206ea07645e863ee717ecbc0/src[…]ages/home/report/ReportActionCompose/ComposerWithSuggestions.js
What changes do you think we should make in order to solve the problem?
This issue happens after the
ReportActionComposerefactor. Previously, when the composer mounted, we always calledupdateCommentto make sureisCommentEmptyhad a correct value, but this approach raised this issue.Even though the issue is marked as not a bug, I still think it's a bug and we shouldn't use the old approach which is a workaround. To fully solve the issue, we should replace _.isEmpty with the regex we use when typing in the composer.
alifhaider commentedon Aug 31, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Composer send button is not disabled when typed text is only spaces
What is the root cause of that problem?
Send Button is only checking for disabled if field is empty or not.
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.js
Lines 452 to 455 in 64ff471
What changes do you think we should make in order to solve the problem?
We can trim the comment and then update
isCommentEmpty. By this, it will remove the start and ending spaces of text, and then make the button enabled and disabled based on that.What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Aug 31, 2023
📣 @alifhaider! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
alifhaider commentedon Aug 31, 2023
Contributor details
Your Expensify account email: alifhaider57@gmail.com
Upwork Profile Link: (https://www.upwork.com/freelancers/~014066482556c551be)
melvin-bot commentedon Aug 31, 2023
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
[-]Web - Composer send button is enabled even when the input contains only space[/-][+][$500] Web - Composer send button is enabled even when the input contains only space[/+]melvin-bot commentedon Sep 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0148ad3caa7badc613
36 remaining items
strepanier03 commentedon Oct 6, 2023
@bernhardoj - You've been paid in Upwork. I left a note on the bonus payment but I thought we had two separate contracts for this job for you so I added the bonus to pay the reporting payment after the fact. Let me know if you have any questions.
@fedirjh - I'll keep my eyes open for an update on the checklist and move forward once there's one.
Thanks everyone!
bernhardoj commentedon Oct 6, 2023
@strepanier03 got it. Thanks! I think you can close the Reporter contract then.
fedirjh commentedon Oct 6, 2023
BugZero Checklist:
Regression Test Proposal
fedirjh commentedon Oct 6, 2023
@strepanier03 The offer was expired for me, could you please send me another offer 🙏🏼
strepanier03 commentedon Oct 6, 2023
Sure thing @fedirjh, I'll do that now.
strepanier03 commentedon Oct 6, 2023
@fedirjh - Sent!
Working on reg test GH now.
strepanier03 commentedon Oct 6, 2023
@bernhardoj - I'll work on closing that next week. For some reason both contracts linked here are for the same contract and paid already.
fedirjh commentedon Oct 9, 2023
@strepanier03 Accepted, Thank you.
strepanier03 commentedon Oct 9, 2023
@fedirjh - I have finished paying you as well. Thanks for accepting that.
Thank you both for being part of our community and working so hard to help us achieve the New Expensify dream.
[-][HOLD for payment 2023-10-05] [$500] Web - Composer send button is enabled even when the input contains only space[/-][+][PAID] [$500] Web - Composer send button is enabled even when the input contains only space[/+]