Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Open a report that has the private note option
- Click on the header > Private notes
- Select a private note to open the edit page
- Edit the private note and press enter key
Expected Result:
The private note should be saved and go back to the previous page
Actual Result:
The input adds a new line
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.77-5
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
Screen.Recording.2023-10-04.at.15.07.46.mov
Screen.Recording.2023-10-04.at.15.08.32.mov
Recording.470.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696405348401729
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01114e9ac4dbe61472
- Upwork Job ID: 1709667574583115776
- Last Price Increase: 2023-10-11
Activity
[-]Edit private note form doesn't submit by enter key[/-][+][$500] Edit private note form doesn't submit by enter key[/+]melvin-bot commentedon Oct 4, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01114e9ac4dbe61472
melvin-bot commentedon Oct 4, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (
External)m-natarajan commentedon Oct 4, 2023
Proposal by @dukenv0307
Please re-state the problem that we are trying to solve in this issue.
Edit private note form doesn't submit by pressing enter key
What is the root cause of that problem?
We don't add
submitOnEnterprop to allow the submission of the form by pressing the enter keyApp/src/pages/PrivateNotes/PrivateNotesEditPage.js
Line 142 in 447d87e
We should add
submitOnEnterprop to the text input to make the form can be submitted by pressing enter keyApp/src/pages/PrivateNotes/PrivateNotesEditPage.js
Line 142 in 447d87e
What alternative solutions did you explore? (Optional)
NA
Result
Screencast.from.04-10-2023.15.19.04.webm
alitoshmatov commentedon Oct 4, 2023
Looks like it is intended behavior. Since notes might be multiline
ayazalavi commentedon Oct 5, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Enter button is not submitting privates notes form.
What is the root cause of that problem?
Root cause of the problem is we have policy about when form should be submitted on pressing enter and when we should add a new line on pressing shift+enter. There is prop for multiline inputs that allow us to handle form like this
App/src/components/TextInput/baseTextInputPropTypes.js
Line 89 in 6d86d5a
it is not added
What changes do you think we should make in order to solve the problem?
Add
submitOnEnter={!Browser.isMobile()}prop hereApp/src/pages/PrivateNotes/PrivateNotesEditPage.js
Line 142 in 6d86d5a
Above change will ensure that enter behavior gets updated for desktop browsers and for mobile apps only.
What alternative solutions did you explore? (Optional)
N/A
jakub-trzebiatowski commentedon Oct 5, 2023
@ayazalavi Does it do any harm to add
submitOnEnterfor mobile browsers too? Don't we support a rare but possible scenario like an Android phone/tablet with a Bluetooth hardware keyboard + mobile Chrome?dukenv0307 commentedon Oct 5, 2023
@cubuspl42 Actually, we use
submitOnEnter={!Browser.isMobile()}in other page and this PR introduce this #27702jakub-trzebiatowski commentedon Oct 5, 2023
I asked also on Slack
ayazalavi commentedon Oct 5, 2023
@cubuspl42, I believe this form submission behavior is intended for platforms other than mobile browsers. Mobile browsers have different form submission behavior due to the lack of implementation for interactions between soft keyboards and HTML forms in the app. Please take a look at this issue for more information: Link to Issue #28569.
melvin-bot commentedon Oct 10, 2023
@cubuspl42 Huh... This is 4 days overdue. Who can take care of this?
jakub-trzebiatowski commentedon Oct 11, 2023
@m-natarajan Let's close this. This might be intended and in another thread we decided that private notes are not a priority as they are mostly an internal feature.
melvin-bot commentedon Oct 11, 2023
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Oct 13, 2023
Triggered auto assignment to @puneetlath (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 13, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)puneetlath commentedon Oct 13, 2023
I agree with @cubuspl42 and I believe this page is being revamped anyways, so let's close this for now.