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
[$500] Android - Rooms can be created when the user presses the Return key while typing in the description #36624
Version Number: 1.4.42.0 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 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Launch the app
Log in with your account
Tap on Plus green button
Select Start Chat - Room
Enter room name
On description, use any text and hit Return key on Samsung device
Expected Result:
Room should not be created
Actual Result:
Rooms can be created when the user presses the Return key while typing in the description
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Android - Rooms can be created when the user presses the Return key while typing in the description[/-][+][$500] Android - Rooms can be created when the user presses the Return key while typing in the description[/+]on Feb 15, 2024
Please re-state the problem that we are trying to solve in this issue.
Android - Rooms can be created when the user presses the Return key while typing in the description
What is the root cause of that problem?
The component tha listens for Enter keyboard shortcut is not able to detect the description field as multiline.
Look here
while the web implementation for validateSubmitShortcut is skipping this event when `eventTarget.nodeName === 'TEXTAREA'
the native implementation does not have any information of the event or what type of element is focused.
To know which input is focus we can use FormContext to store that info.
<InputWrapper
InputComponent={TextInput}
inputID={INPUT_IDS.REPORT_DESCRIPTION}
onTouched={} // here
onBlur={} // here
What changes do you think we should make in order to solve the problem?
Update KeyboardShortcutComponent and add new arg isMultiline
and use that in the validateSubmitShortcut function.
Because the keyboardShortcutComponent is only used locally this change will not break other parts of the app, and it will be the expected behaviour to not submit the form when the user presses Enter while typing in a multiline field.
What alternative solutions did you explore? (Optional)
Check if bindHandlerToKeydownEvent emit any useful information when the enter key is pressed on native, the event was just undefined.
Tyr to get the focused node and figure out if it is a multiline field, but native do not support focus.
@kevinksullivan I am a little lost here on the expected behavior. Based on @ishpaul777's comment it was done intentionally? Are we looking to rollback the change or only fix for Android?
@kevinksullivan Can you please confirm the expected behavior?
Activity
[-]Android - Rooms can be created when the user presses the Return key while typing in the description[/-][+][$500] Android - Rooms can be created when the user presses the Return key while typing in the description[/+]melvin-bot commentedon Feb 15, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01fe10c08e956825df
melvin-bot commentedon Feb 15, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)melvin-bot commentedon Feb 15, 2024
Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.kbecciv commentedon Feb 15, 2024
We think that this bug might be related to #vip-vsb
CC @quinthar
neonbhai commentedon Feb 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Rooms can be created when the user presses the Return key while typing in the description
What is the root cause of that problem?
We don't disable pressing the submit button on enter here
What changes do you think we should make in order to solve the problem?
We should change disable press on enter to
trueAlternatively
We can remove the prop
eucool commentedon Feb 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Rooms can be created when the user presses the Return key while typing in the description
What is the root cause of that problem?
We do not define the type of functionality for enter button for the description
InputWrapper:App/src/pages/workspace/WorkspaceNewRoomPage.js
Lines 312 to 322 in 23b749a
What changes do you think we should make in order to solve the problem?
pass a default prop (React documentation)
returnKeyTypeand set it todone:What alternative solutions did you explore? (Optional)
N/A
Krishna2323 commentedon Feb 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Rooms can be created when the user presses the Return key while typing in the description
What is the root cause of that problem?
The issue seems device specific, not reproducible on emulator, but I believe it can be solved if we pass the props below conditionally.
App/src/pages/workspace/WorkspaceNewRoomPage.js
Line 299 in 23b749a
What changes do you think we should make in order to solve the problem?
We should pass false if
DeviceCapabilities.canUseTouchScreen() && isMediumScreenWidthis true.disablePressOnEnter={DeviceCapabilities.canUseTouchScreen() && isMediumScreenWidth}Additionally we can also check for
platform !== 'android'.Result
agent3bood commentedon Feb 18, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Android - Rooms can be created when the user presses the Return key while typing in the description
What is the root cause of that problem?
The component tha listens for
Enterkeyboard shortcut is not able to detect the description field as multiline.Look here
while the web implementation for
validateSubmitShortcutis skipping this event when `eventTarget.nodeName === 'TEXTAREA'the native implementation does not have any information of the event or what type of element is focused.
To know which input is focus we can use
FormContextto store that info.What changes do you think we should make in order to solve the problem?
Update
KeyboardShortcutComponentand add new argisMultilineand use that in the
validateSubmitShortcutfunction.Because the
keyboardShortcutComponentis only used locally this change will not break other parts of the app, and it will be the expected behaviour to not submit the form when the user pressesEnterwhile typing in a multiline field.What alternative solutions did you explore? (Optional)
bindHandlerToKeydownEventemit any useful information when the enter key is pressed on native, theeventwas justundefined.25 remaining items
mananjadhav commentedon Mar 10, 2024
@kevinksullivan Can you please confirm the expected behavior?
melvin-bot commentedon Mar 13, 2024
@mananjadhav, @kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Mar 14, 2024
📣 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 Mar 14, 2024
@mananjadhav @kevinksullivan this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
melvin-bot commentedon Mar 14, 2024
Current assignee @mananjadhav is eligible for the Internal assigner, not assigning anyone new.
melvin-bot commentedon Mar 15, 2024
@mananjadhav, @kevinksullivan Huh... This is 4 days overdue. Who can take care of this?
kevinksullivan commentedon Mar 15, 2024
Huh, closing out if this was by design. @kbecciv was there a particular test you ran where it suggested this was a bug?
kbecciv commentedon Mar 19, 2024
@kevinksullivan No particular test, exploratory issue!