Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

History popup cropped on bottom #423

Closed
akloeckner opened this issue Sep 7, 2020 · 9 comments · Fixed by #508
Closed

History popup cropped on bottom #423

akloeckner opened this issue Sep 7, 2020 · 9 comments · Fixed by #508

Comments

@akloeckner
Copy link
Contributor

akloeckner commented Sep 7, 2020

I found that my popups are cropped at the bottom, when their height hits the max-height:

Screenshot_2020-09-07-22-29-36

It can be fixed by subtracting 60px in custom css:

.popup--tiles {
  max-height: calc(100vh - 50px - 80px - 30px - 62px); 
  border: 1px solid red;
}

It's easiest testable by opening a history popup on mobile and turning your phone to landscape. Both in Chrome and Firefox. I am pretty sure, this was correct when I migrated history popup to the modular popup.

Do you see this, too? Or is it some strange setting of mine, which I just didn't find?

If it's a real issue: why 60px?!

@rchl
Copy link
Collaborator

rchl commented Sep 9, 2020

Can you reproduce this in a Desktop browser (using mobile mode and switching orientation if needed)? I can't seem to be able to reproduce on Desktop at least.

@akloeckner
Copy link
Contributor Author

I'll try this weekend. How can I switch Firefox to mobile mode? Or is it just the screen size in the developer's tools?

@rchl
Copy link
Collaborator

rchl commented Sep 9, 2020

Screenshot 2020-09-09 at 15 04 39

@akloeckner
Copy link
Contributor Author

I don't have that issue in Firefox Desktop. I tried the mobile view and even switched to touch simulation.

I also realized that I don't have the issue in my mobile WebApp either, i.e., when I load tileboard through the shortcut and no browser title is displayed on my phone (which btw. is new since not so long ago, not sure if ou changed something or firefox). If I load tileboard with a browser title bar, the problem appears. Be it in Firefox mobile, in Chrome mobile or in Chrome Webapp. Sometimes, even the background is cropped. I'll upload some pictures.

@akloeckner
Copy link
Contributor Author

Firefox WebApp

Screenshot_2020-09-11-15-24-54

Firefox

Screenshot_2020-09-11-15-25-19

Chrome Webapp

Screenshot_2020-09-11-15-25-49

Chrome

Screenshot_2020-09-11-15-26-12

@akloeckner
Copy link
Contributor Author

Maybe related:
https://css-tricks.com/the-trick-to-viewport-units-on-mobile/

TL;DR: vh is not the visible area, but the full mobile screen for Chrome. It can be circumvented with JS. Maybe that behavior changed recently in Firefox, too. As apparently did the WebApp default appearance regarding the navigation bar.

@rchl
Copy link
Collaborator

rchl commented Sep 11, 2020

That sliding toolbar in chrome has some magic to it. I sometimes see such issue on normal pages.

@akloeckner
Copy link
Contributor Author

I tested the solution from my link above. It works for the popup. Would you approve such a solution in app.js? It seems to be the accepted solution in all discussions I have seen.

However, I haven't solved the cropped background in the Firefox screenshot yet. Still investigating...

@rchl
Copy link
Collaborator

rchl commented Sep 12, 2020

I'm fine with adding some workaround for this.

Or maybe this approach mentioned in the article will work as well:

There is another fix for this that has come along more recently. Matt Smith documents it here. The trick is min-height: -webkit-fill-available; on the body as a progressive enhancement over 100vh, which should work on iOS devices.

Seems a bit cleaner.

And whatever you do, consider browsers that don't support vh and other new APIs and do it in a "progressive enhancement" way so that it helps new browsers but doesn't break old ones.

akloeckner added a commit to akloeckner/TileBoard that referenced this issue Oct 28, 2020
fixes resoai#423

this uses the first approach suggested in the issue
I just couldn't get the other one to work...
@rchl rchl closed this as completed in #508 Oct 29, 2020
rchl pushed a commit that referenced this issue Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants