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
[HOLD for payment 2023-07-12] [$1000] The Keyboard shortcuts modal does not render correctly when the window is resized. #21643
Navigated to the Settings page, then to the About page.
Clicked on "View keyboard shortcuts".
Decreased the window size.
Maximized the browser window.
Observed that the Keyboard shortcuts modal is not in the center of the page.
Expected Result:
The Keyboard shortcuts modal should be in the center of the page.
Actual Result:
The Keyboard shortcuts modal does not render correctly when the window is resized.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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.32-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
Please re-state the problem that we are trying to solve in this issue.
The Keyboard shortcuts modal does not render correctly when the window is resized from small screen to large screen.
What is the root cause of that problem?
To reproduce this issue, just going from a small width to a large width while the modal is open also causes this issue to happen. Further, we can notice that a console error is thrown in DEV when the resizing happens.
The reason behind this issue is that when the browser is in large screen width, it has the CSS property flexBasis: auto and flex: 1. Both these values are obtained from here:
When the window is resized to small screen width, it obtains the styles from modal type BOTTOM_DOCKED, which do not have a flex CSS property set. This leads to a situation where the flex style is removed while the flexBasis style is present, causing the visual glitch to occur. Similarly, when the window is resized to large width, the flex style is set from being undefined, causing the issue to occur,
What changes do you think we should make in order to solve the problem?
Ideally, we do not want to change the base styles for the popovers. Taking this into consideration, we can change the style keyboardShortcutModalContainer to use flex: 0 and remove flexShrink and flexGrow. This will ensure that no matter the width, the flex style is always taken into consideration. After resolution, the style will always be set to flex: 0 0 auto.
What alternative solutions did you explore? (Optional)
To fix this issue, we can add flex: 1 style to the BOTTOM_DOCKED modal type in modalContainerStyle.
Alternatively, we can remove flex: 1 style from CENTERED_UNSWIPEABLE modal type from getBaseModalStyles.
Please re-state the problem that we are trying to solve in this issue.
The Keyboard shortcuts modal does not render correctly when the window is resized.
What is the root cause of that problem?
Warning: Updating a style property during rerender (flex) when a conflicting property is set (flexShrink) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.
As the error mentions don't mix the shorthand and no-shorthand properties and seems that we are doing here(where modalContainerStyle contains shorthand property flex: 1 and innerContainerStyle has properties of keyboardShortcutModalContainer which are non-shorthand).
What changes do you think we should make in order to solve the problem?
As for the modal container type we are using the flex shorthand syntax here, let's do the same for the keyboardShortcutModalContainer to avoid this conflict issue. This raises the issue for the native, so we need to replace shorthand with the normal properties in the getBaseModalStyles.
changed the title [-]The Keyboard shortcuts modal does not render correctly when the window is resized.[/-][+][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+]on Jun 28, 2023
changed the title [-][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/-][+][HOLD for payment 2023-07-12] [$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+]on Jul 5, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.36-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-07-12. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
Merged PR within 3 business days of assignment - 50% bonus
Merged PR more than 9 business days after assignment - 50% penalty
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
[@0xmiroslav] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@0xmiroslav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@0xmiroslav] Determine if we should create a regression test for this bug.
[@0xmiroslav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@tjferriss] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug.
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
As web resizing to mobile window is rare case and we won't be likely to change this style again, I don't think regression test step is needed.
Activity
GItGudRatio commentedon Jun 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Keyboard shortcuts modal does not render correctly when the window is resized from small screen to large screen.
What is the root cause of that problem?
To reproduce this issue, just going from a small width to a large width while the modal is open also causes this issue to happen. Further, we can notice that a console error is thrown in DEV when the resizing happens.

The reason behind this issue is that when the browser is in large screen width, it has the CSS property
flexBasis: autoandflex: 1. Both these values are obtained from here:App/src/styles/styles.js
Line 3001 in ae8a751
App/src/styles/getModalStyles/getBaseModalStyles.js
Line 116 in b8d4576
When the window is resized to small screen width, it obtains the styles from modal type
BOTTOM_DOCKED, which do not have aflexCSS property set. This leads to a situation where theflexstyle is removed while theflexBasisstyle is present, causing the visual glitch to occur. Similarly, when the window is resized to large width, theflexstyle is set from being undefined, causing the issue to occur,What changes do you think we should make in order to solve the problem?
Ideally, we do not want to change the base styles for the popovers. Taking this into consideration, we can change the style
keyboardShortcutModalContainerto useflex: 0and removeflexShrinkandflexGrow. This will ensure that no matter the width, the flex style is always taken into consideration. After resolution, the style will always be set toflex: 0 0 auto.What alternative solutions did you explore? (Optional)
To fix this issue, we can add
flex: 1style to theBOTTOM_DOCKEDmodal type inmodalContainerStyle.Alternatively, we can remove
flex: 1style fromCENTERED_UNSWIPEABLEmodal type fromgetBaseModalStyles.melvin-bot commentedon Jun 26, 2023
Triggered auto assignment to @tjferriss (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 26, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)Pujan92 commentedon Jun 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Keyboard shortcuts modal does not render correctly when the window is resized.
What is the root cause of that problem?
Warning: Updating a style property during rerender (flex) when a conflicting property is set (flexShrink) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.As the error mentions don't mix the shorthand and no-shorthand properties and seems that we are doing here(where
modalContainerStylecontains shorthand propertyflex: 1andinnerContainerStylehas properties ofkeyboardShortcutModalContainerwhich are non-shorthand).App/src/styles/getModalStyles/getBaseModalStyles.js
Line 252 in 1a2072f
App/src/components/KeyboardShortcutsModal.js
Line 159 in d76b1ad
App/src/styles/styles.js
Lines 2998 to 3003 in d76b1ad
What changes do you think we should make in order to solve the problem?
As for the modal container type we are using the flex shorthand syntax here, let's do the same for the
keyboardShortcutModalContainerto avoid this conflict issue. This raises the issue for the native, so we need to replace shorthand with the normal properties in thegetBaseModalStyles.Instead of
App/src/styles/getModalStyles/getBaseModalStyles.js
Line 81 in ecfcd83
App/src/styles/getModalStyles/getBaseModalStyles.js
Line 116 in ecfcd83
Update to
Result
Screen.Recording.2023-06-27.at.3.51.20.AM.mp4
[-]The Keyboard shortcuts modal does not render correctly when the window is resized.[/-][+][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+]melvin-bot commentedon Jun 28, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01a27dd51f1042e7a5
tjferriss commentedon Jun 28, 2023
I'm able to reproduce this one.
melvin-bot commentedon Jun 28, 2023
Current assignee @tjferriss is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 28, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (
External)17 remaining items
[-][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/-][+][HOLD for payment 2023-07-12] [$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+]melvin-bot commentedon Jul 5, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 5, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.36-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-07-12. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Jul 5, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
tjferriss commentedon Jul 12, 2023
@GItGudRatio can you please apply to the job post here for payment? https://www.upwork.com/jobs/~01a27dd51f1042e7a5
@0xmiroslav can you get started on the checklist?
0xmiroslav commentedon Jul 12, 2023
As web resizing to mobile window is rare case and we won't be likely to change this style again, I don't think regression test step is needed.
GItGudRatio commentedon Jul 12, 2023
@tjferriss Thanks, applied!
tjferriss commentedon Jul 12, 2023
@0xmiroslav and @Tushu17 payments have been sent. @GItGudRatio once you accept the offer, I'll process your payment and we can close the issue.
GItGudRatio commentedon Jul 12, 2023
Thank you @tjferriss!