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] Different behavior for mobile and mWeb when user opens an attachment and tries to go back - Reported by @thesahindia #7010
EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2
Different behavior for mobile and mobile web when the user opens an attachment and tries to go back using the native back button.
Mobile :- The user go back to the chat.
Mobile web :- The chat closes itself.
changed the title [-]Different behavior for mobile and mWeb when user opens an attachment and tries to go back - Reported by @thesahindia[/-][+][$500] Different behavior for mobile and mWeb when user opens an attachment and tries to go back - Reported by @thesahindia[/+]on Jan 19, 2022
I have done some research on this and it seems that the solution will be complicated and it requires hacks. There is no default way of doing this using browser technologies.
we first need to add an empty entry to the history state whenever a modal is opened.
so when the user will close the modal of pressing the back button that entry will be popped instead of going back.
Now attach an event handler to popstate event to check if our entry was popped out then close the modal.
Based on the discussion necolas/react-native-web#1738. RN-web authors considers this behavior hacky and will not implement it in their repo. Nor this can be considered a part of react-native-modal repo as it depends on BackHandler or onClose event on Modal component. Thus if RN-web implements this onClose for Modal then it will start working.
In Short, popstate event can not be canceled or prevented so it requires hacks to overcome this.
So, I suggest we close this as it is an edge case and most of the mobile-web users would be used to closing modal via the cross button.
@parasharrajat Understand your point. I also checked this issue and trying with window popstate listener and it seems tricky for now but at least somehow it works but not perfectly. I have an idea from my mind. Let me try to add a hash when view image modal open then will see what happen. I will show you guys then.
Yeah, I'm fine with keeping things simple and closing this. I like keeping things consistent where possible, but in this case we can consider it a platform limitation. It's not a severe bug either, just a mild inconsistency.
EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2
Activity
MelvinBot commentedon Jan 4, 2022
Triggered auto assignment to @stitesExpensify (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.stitesExpensify commentedon Jan 6, 2022
Yep definitely a bug. @thesahindia do you want to propose a solution?
MelvinBot commentedon Jan 6, 2022
Triggered auto assignment to @NicMendonca (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.NicMendonca commentedon Jan 6, 2022
Upwork job post: https://www.upwork.com/jobs/~0167b446c2be6b25f4
MelvinBot commentedon Jan 6, 2022
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
Exported)4 remaining items
stitesExpensify commentedon Jan 7, 2022
IMO the expected behavior is that the user ends up back at the chat. Do you agree @NicMendonca ?
NicMendonca commentedon Jan 10, 2022
Yep, I agree with that 👍
NicMendonca commentedon Jan 19, 2022
@phivh do you have any questions after reading @parasharrajat's feedback?
phivh commentedon Jan 19, 2022
@NicMendonca Nope, I will look again the navigation, then give a proposal if I have.
NicMendonca commentedon Jan 19, 2022
Doubled the price to $500: https://www.upwork.com/jobs/~0167b446c2be6b25f4
[-]Different behavior for mobile and mWeb when user opens an attachment and tries to go back - Reported by @thesahindia[/-][+][$500] Different behavior for mobile and mWeb when user opens an attachment and tries to go back - Reported by @thesahindia[/+]parasharrajat commentedon Jan 21, 2022
I have done some research on this and it seems that the solution will be complicated and it requires hacks. There is no default way of doing this using browser technologies.
Based on the discussion necolas/react-native-web#1738. RN-web authors considers this behavior hacky and will not implement it in their repo. Nor this can be considered a part of react-native-modal repo as it depends on BackHandler or onClose event on Modal component. Thus if RN-web implements this onClose for Modal then it will start working.
In Short, popstate event can not be canceled or prevented so it requires hacks to overcome this.
So, I suggest we close this as it is an edge case and most of the mobile-web users would be used to closing modal via the cross button.
phivh commentedon Jan 21, 2022
@parasharrajat Understand your point. I also checked this issue and trying with window popstate listener and it seems tricky for now but at least somehow it works but not perfectly. I have an idea from my mind. Let me try to add a hash when view image modal open then will see what happen. I will show you guys then.
mallenexpensify commentedon Jan 21, 2022
@stitesExpensify @roryabraham you two cool with closing this based on Rajat's reasoning above?
stitesExpensify commentedon Jan 21, 2022
I'm fine with closing this. @roryabraham can have the final call
roryabraham commentedon Jan 26, 2022
Yeah, I'm fine with keeping things simple and closing this. I like keeping things consistent where possible, but in this case we can consider it a platform limitation. It's not a severe bug either, just a mild inconsistency.
melvin-bot commentedon Sep 28, 2022
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a production regression has occurred a Root Cause Analysis is required. Please follow the instructions here.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.