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

UI Bugfix Mobile: Add distance at the bottom, if there is a difference between window.innerHeight and window.outerHeight #1827

Conversation

relativisticelectron
Copy link
Collaborator

Fix for #1826

@netlify
Copy link

netlify bot commented Jul 29, 2022

Deploy Preview for specter-desktop-docs ready!

Name Link
🔨 Latest commit 9f85100
🔍 Latest deploy log https://app.netlify.com/sites/specter-desktop-docs/deploys/62f299a167321900098299c3
😎 Deploy Preview https://deploy-preview-1827--specter-desktop-docs.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 settings.

@moneymanolis
Copy link
Collaborator

moneymanolis commented Aug 6, 2022

This currently creates huge additional space at the bottom of the tx table for me:

grafik

I think it would be good to use media queries to restrict the extra spacing to mobile devices, have a look here for more on that:
https://wpbuffs.com/media-query-for-mobile/

Sth. like this:


@media only screen and (max-width: 600px) {
.mobile-distance-element-botom {
    height: mobileDistanceElementBotomHeight; /* Fallback for browsers that do not support Custom Properties */
    height: var(--mobileDistanceElementBotomHeight, mobileDistanceElementBotomHeight);
    flex-shrink: 0;
    width: 100%;
  }
}

BTW: I could not reproduce the issue in the first place using Firefox but this depends on so much stuff besides the browser.
Update: Could reproduce it with Safari.

See: https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
This style is used for a div at the bottom in the <main> element to create a distance at the bottom of the pages
*/
.mobile-distance-element-botom {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo, should be bottom

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. (now)

This style is used for a div at the bottom in the <main> element to create a distance at the bottom of the pages
*/
.mobile-distance-element-botom {
height: mobileDistanceElementBotomHeight; /* Fallback for browsers that do not support Custom Properties */
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this a fallback? What would such a browser do with "mobileDistanceElementBotomHeight"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it.

@relativisticelectron
Copy link
Collaborator Author

This currently creates huge additional space at the bottom of the tx table for me:

Strange. Ok. Then this difference calculation is not a good idea.

I think it would be good to use media queries to restrict the extra spacing to mobile devices, have a look here for more on that: https://wpbuffs.com/media-query-for-mobile/

Sth. like this:


@media only screen and (max-width: 600px) {
.mobile-distance-element-botom {
    height: mobileDistanceElementBotomHeight; /* Fallback for browsers that do not support Custom Properties */
    height: var(--mobileDistanceElementBotomHeight, mobileDistanceElementBotomHeight);
    flex-shrink: 0;
    width: 100%;
  }
}

BTW: I could not reproduce the issue in the first place using Firefox but this depends on so much stuff besides the browser. Update: Could reproduce it with Safari.

Ok, I will try the @media.

@moneymanolis
Copy link
Collaborator

Also: Did you try this approach as well?
https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
Would be a bit more tailored towards the individual viewports than the difference between innerHeight and outerHeight.

Does not work for Safari for me, though, and Firefox works fine without anything for me, so can't verify whether this helps as well.

@relativisticelectron
Copy link
Collaborator Author

Also: Did you try this approach as well? https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ Would be a bit more tailored towards the individual viewports than the difference between innerHeight and outerHeight.

Does not work for Safari for me, though, and Firefox works fine without anything for me, so can't verify whether this helps as well.

This is where I have the idea from to use the innerHeight, and then discovered that outerHeight - innerHeight fits the height of the navigation bar. Their JS code is not directly applicable, because we have nothing to shrink. On our endpoints are various elements that get cut off by the navigation bar.

…_bottom_mobile

# Conflicts:
#	src/cryptoadvance/specter/static/styles.css
@relativisticelectron
Copy link
Collaborator Author

relativisticelectron commented Aug 6, 2022

I am unsure if window.outerHeight is the correct approach for mobile. I now changed it to a fixed height if it is a narrow screen.

EDIT: I think for mobile window.outerHeight (see https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight ) is acceptable. I added it back in, but only for narrow screens as you suggested.

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

Successfully merging this pull request may close these issues.

None yet

2 participants