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
[$250] Can't go back in "Contact methods" if triggering "Back" button using Enter #29132
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
changed the title [-]Can't go back in "Contact methods" if triggering "Back" button using Enter[/-][+][$500] Can't go back in "Contact methods" if triggering "Back" button using Enter[/+]on Oct 9, 2023
The issue is with pressOnEnter prop here so on pressing enter, New Contact Method button is triggered.
What changes do you think we should make in order to solve the problem?
As the contact methods page does not contain any input elements (like text of selection) we dont need pressOnEnter functionality here.
We can just remove the prop and it will work fine.
What alternative solutions did you explore? (Optional)
changed the title [-][$500] Can't go back in "Contact methods" if triggering "Back" button using Enter[/-][+][$250] Can't go back in "Contact methods" if triggering "Back" button using Enter[/+]on Oct 10, 2023
We shouldn't be focusing on this issue ATM. We are migrating to RN-web v0.19 which will allow us to use button components instead of simple View thus this issue won't happen. This change is being tracked on some other issue.
Also, this is something that might be facing on almost all pages of the app and we have closed these in the past. I would do the same until we are ready to focus on such issues.
Please re-state the problem that we are trying to solve in this issue.
On Contact Methods page after focusing on the back button with the Tab key and pressing enter; it doesn't navigate back
What is the root cause of that problem?
Because there is the new contact methods button with pressOnEnter enabled, in addition to the navigate back code the create new contact methods' code is also executed. So that's why the page will navigate to the new contact page and it will get back to the contact methods page(instead of navigating back to the profiles page).
What changes do you think we should make in order to solve the problem?
This problem must exist everywhere there is a Button component with pressOnEnter enabled. So the fix should be applied to our Button component.
Changes to be applied:
Here,
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
[-]Can't go back in "Contact methods" if triggering "Back" button using Enter[/-][+][$500] Can't go back in "Contact methods" if triggering "Back" button using Enter[/+]melvin-bot commentedon Oct 9, 2023
Job added to Upwork: https://www.upwork.com/jobs/~014d24f78857b6fbc3
saranshbalyan-1234 commentedon Oct 9, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Can't go back in "Contact methods" if triggering "Back" button using Enter
What is the root cause of that problem?
App/src/pages/settings/Profile/Contacts/ContactMethodsPage.js
Lines 137 to 142 in b2cbd26
The issue is with pressOnEnter prop here so on pressing enter, New Contact Method button is triggered.
What changes do you think we should make in order to solve the problem?
As the contact methods page does not contain any input elements (like text of selection) we dont need pressOnEnter functionality here.
We can just remove the prop and it will work fine.
What alternative solutions did you explore? (Optional)
N/A
melvin-bot commentedon Oct 9, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (
External)Krishna2323 commentedon Oct 9, 2023
I believe it comes under accessibility and we closed multiple issue that are related to accessibility as we are not focusing on it right now.
cc: @thesahindia
[-][$500] Can't go back in "Contact methods" if triggering "Back" button using Enter[/-][+][$250] Can't go back in "Contact methods" if triggering "Back" button using Enter[/+]cead22 commentedon Oct 10, 2023
This looks like a simple bug, and I imagine the solution will be simple as well, so I decreased the bounty
melvin-bot commentedon Oct 10, 2023
Upwork job price has been updated to $250
Victor-Nyagudi commentedon Oct 10, 2023
A pull request affecting the Enter key's behavior got merged and recently deployed to production.
It could provide some insight on why this issue occurred.
parasharrajat commentedon Oct 10, 2023
We shouldn't be focusing on this issue ATM. We are migrating to RN-web v0.19 which will allow us to use button components instead of simple View thus this issue won't happen. This change is being tracked on some other issue.
Also, this is something that might be facing on almost all pages of the app and we have closed these in the past. I would do the same until we are ready to focus on such issues.
FitseTLT commentedon Oct 10, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Contact Methods page after focusing on the back button with the
Tabkey and pressing enter; it doesn't navigate backWhat is the root cause of that problem?
Because there is the new contact methods button with
pressOnEnterenabled, in addition to the navigate back code the create new contact methods' code is also executed. So that's why the page will navigate to the new contact page and it will get back to the contact methods page(instead of navigating back to the profiles page).What changes do you think we should make in order to solve the problem?
This problem must exist everywhere there is a
Buttoncomponent withpressOnEnterenabled. So the fix should be applied to ourButtoncomponent.Changes to be applied:
Here,
App/src/components/Button/index.js
Lines 181 to 185 in a6d2f3e
we need additional logic to check if the focus is not on another element (it should be on the button element or on its parent) so it should be changed to
if(document.activeElement.contains(this.ref.current)) this.props.onPress();POC:
https://github.com/Expensify/App/assets/38649957/2a9e55d2-01be-4cdd-b2a0-faaf5000f46d
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Oct 10, 2023
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 10, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)cead22 commentedon Oct 10, 2023
Closing per #29132 (comment)