Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mobile modal button visible #138

Merged
merged 8 commits into from
Dec 4, 2023
Merged

fix: mobile modal button visible #138

merged 8 commits into from
Dec 4, 2023

Conversation

ColinBuyck
Copy link
Collaborator

@ColinBuyck ColinBuyck commented Nov 21, 2023

Pull Request Template

#133

Description

This PR updates the modal and overlay components so that the actions in the footer will be visible on mobile devices whether the bottom search bar is up or not. This fix is made possible by using dvh which is supported by over 90% of users (source).

In the event that dvh is not supported, this PR includes a fallback solution which adds static padding which will keep full height modals actionable.

Why does this work?

Setting the max height to 100dvh or dynamic view height prevents the modal buttons being blocked since it adjusts based on whether browser ux pieces are expanded or retracted (ie. search bar).

The fallback approach came to be since without dvh, we have to manually move the full-screen modal up to sit higher than browser ux pieces. This is achieved by the padding but then this causes non-fullscreeen modals to show a large footer. However with background-clip and removing the border and shadow, we can create that shift upward without detracting from the modals not taking up the full screen.

There is one edge case that wasn't able to be resolved based on the time-sensitivity of this fix and how rare this case is. The screen recroding below would only come up if a user had a mobile browser that didn't support dvh and was on a modal with overflow content (rather than scrollable). Also the screen recording doesn't account for the majority of the grayed out space being covered by the mobile browser's search or tool bar.
https://github.com/bloom-housing/ui-components/assets/53269332/0d6e6fb6-f5b4-4b9c-9aaa-72d98770dff8

How Can This Be Tested/Reviewed?

To test this directly, symlink this UIC to bloom and then run it locally. Access the public site on your mobile device and click into a listing with multiple images. Test Coliseum should work if you just seeded. Open the multi-photo modal and ensure the close button is visible at the bottom of your different browsers.

Also ensure the modal and image card stories are still functional on Storybook on both large and small devices.

A small note that in my testing, I noticed that this doesn't work for the multiple image card story if accessing storybook on your phone and then clicking full screen (button below). I think this is because of how storybook canvas represents a full screen and believe that local instance is support enough of this fix.
Screenshot 2023-11-30 at 5 16 04 PM

Checklist:

  • My code follows the style guidelines of this project
  • I have added QA notes to the issue
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have made any corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated stories if new changes are not captured in Storybook
  • New and existing unit tests pass locally with my changes
  • I have exported any new pieces added to ui-components
  • I have documented this change in the changelog, and any breaking changes are well described

Reviewer Notes:

Steps to review a PR:

  • Read and understand the issue, and ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Either review the Storybook preview or pull the changes down locally and test that the acceptance criteria is met
  • Either explicitly ask a clarifying question, request changes, or approve the PR if there are small remaining changes but the PR is otherwise good to go

On merge, squash commits.

Copy link

netlify bot commented Nov 21, 2023

Deploy Preview for storybook-bloom-dev ready!

Name Link
🔨 Latest commit 50d2c4c
🔍 Latest deploy log https://app.netlify.com/sites/storybook-bloom-dev/deploys/6569466b3fb8890008fa8247
😎 Deploy Preview https://deploy-preview-138--storybook-bloom-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ColinBuyck ColinBuyck changed the title fix: initial attempt fix: mobile modal button visible Dec 1, 2023
@@ -49,14 +49,22 @@
width: auto;
}

max-height: 100vh;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already set on lines 37 + 38 by the variables

@@ -254,30 +254,6 @@ export const ScrollableModalMinimalContent = () => {
)
}

export const TransparentOverlayModal = () => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talking with Emily, we determined this story was not representative or realistic so it's removed here

@ColinBuyck ColinBuyck marked this pull request as ready for review December 1, 2023 02:34
Copy link
Collaborator

@cade-exygy cade-exygy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you!

@ColinBuyck ColinBuyck merged commit 64941dd into main Dec 4, 2023
8 checks passed
Copy link

github-actions bot commented Dec 4, 2023

🎉 This PR is included in version 12.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants