Closed lanitochka17 closed 2 months ago
Triggered auto assignment to @strepanier03 (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@strepanier03 FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Switch to Expensify Classic RHP cannot be dismissed via ESC key after refreshing the page
We subscribe to the 'Esc' key to close the RHN modal in this code. However, after refreshing the page, the event listener is not re-subscribed because the SidebarLinks component isn't reopened.
We should move that event listener to other position like this
useEffect(() => {
const unsubscribeOnyxModal = onyxSubscribe({
key: ONYXKEYS.MODAL,
callback: (modalArg) => {
if (modalArg === null || typeof modalArg !== 'object') {
return;
}
modal.current = modalArg;
},
});
const shortcutConfig = CONST.KEYBOARD_SHORTCUTS.ESCAPE;
const unsubscribeEscapeKey = KeyboardShortcut.subscribe(
shortcutConfig.shortcutKey,
() => {
if (modal.current.willAlertModalBecomeVisible) {
return;
}
if (modal.current.disableDismissOnEscape) {
return;
}
Navigation.dismissModal();
},
shortcutConfig.descriptionKey,
shortcutConfig.modifiers,
true,
true,
);
return () => {
if (unsubscribeEscapeKey) {
unsubscribeEscapeKey();
}
if (unsubscribeOnyxModal) {
unsubscribeOnyxModal();
}
};
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, []);
Same issue as https://github.com/Expensify/App/issues/46915
Closing in favor of #46915 which is two weeks old.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.22-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: N/A Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Switch to Expensify Classic RHP can be dismissed via ESC key after refreshing the page
Actual Result:
Switch to Expensify Classic RHP cannot be dismissed via ESC key after refreshing the page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/62f146f5-a6e8-4cb5-bb7a-1d4ea849e6ff
View all open jobs on GitHub