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

Clickable icon areas is inconsistent in Firefox Mobile #993

Closed
benalleng opened this issue Mar 29, 2024 · 10 comments · Fixed by #1011
Closed

Clickable icon areas is inconsistent in Firefox Mobile #993

benalleng opened this issue Mar 29, 2024 · 10 comments · Fixed by #1011

Comments

@benalleng
Copy link
Contributor

benalleng commented Mar 29, 2024

Description
The clickable area of the users profile, search, home, and notifications is fixed in place on Mobile Firefox. It does not move as the address bar comes and goes

Steps to Reproduce
Scroll or navigate to make the address bar disappear in mobile Firefox and then attempt to click on the user, search, home, or notifications icon. Then click ~height of address bar above the icon

Expected behavior
The clickable area of the user's icon should follow the rest of the navbar

Screenshots
mobile screenshots are huge and I'm too lazy to make them img tags

markup_1000005970

markup_1000005969

Environment:
If you only experience the issue on certain devices or browsers, provide that info.

  • Device: Google Pixel 4a
  • OS: Android
  • Browser Firefox v124.1.0

Additional context
Tested in chrome but the navbar on my browser there is at the top and I could not reproduce.

Tested as both logged in and anon

Post seems to have it's own unique behavior where the button is clickable both on and above the rendered button

Spamming the buttons occasionally seems to fix it

Footer styling is often impacted by the position css so perhaps that is a good place to start to see if it affected by absolute, fixed, or static

@benalleng benalleng added the bug label Mar 29, 2024
@benalleng benalleng changed the title Profile icon clickable area is inconsistent in Firefox Mobile Clickable icon areas is inconsistent in Firefox Mobile Mar 29, 2024
@huumn
Copy link
Member

huumn commented Mar 29, 2024

That's weird. I suspect it's a bug in firefox. We're not doing anything hacky here. The bottom nav isn't even position: fixed.

@benalleng
Copy link
Contributor Author

benalleng commented Mar 29, 2024

It might be that something like position fixed is missing, here is a screenshot of the navbar on my device

some preliminary testing shows me that adding position: fixed;, fixes it but position stuff can get weird so i want to do a little more testing

@benalleng
Copy link
Contributor Author

benalleng commented Mar 29, 2024

since I can't reproduce on chromium stuff it might be a moment when we go down @-moz-document hell lol

@huumn
Copy link
Member

huumn commented Mar 29, 2024

We definitely don't want it be position: fixed. As is, it's in the normal DOM flow using flex properties which is more adaptable (because coupling is looser as the element isn't overlayed on other elements).

@huumn
Copy link
Member

huumn commented Mar 29, 2024

here is a screenshot of the navbar on my device

I think this demonstrates this a bug in firefox. Perhaps doing something silly like bottom: 0px fixes it.

@benalleng
Copy link
Contributor Author

It looks like there is already a style bottom: 0px; any reason you want to avoid postion: fixed; and adding margin-bottom: 52px; to the footer to prevent overlap?

@huumn
Copy link
Member

huumn commented Mar 29, 2024

Mostly because it's less of a hack imo:

As is, it's in the normal DOM flow using flex properties which is more adaptable (because coupling is looser as the element isn't overlayed on other elements)


Adding things like margin-bottom: 52px means should the sizes of things change, we need to change this value.


We don't know what the disease exactly is here yet and don't want to only treat the symptom. If we figure out why this occurs, we might be able to preserve the benefits of flex by doing some small tweak to workaround firefox's bug.

@benalleng
Copy link
Contributor Author

ok, i'll keep looking at getting it to work, found a thread about some bugs with position sticky and flex, see what i can find there

@huumn
Copy link
Member

huumn commented Mar 29, 2024

Cool. There might be an alternative way to do this using display: grid or some other combo of things ... position: sticky seems to be pretty buggy in most mobile browsers. And I didn't put effort into finding the best way to do this. I just know fixed is a pain to maintain.

(related: the top sticky bar is now position: fixed because ios safari has a bug with sticky when the virtual keyboard is shown ... but that didn't require adding other margin/padding ... still, it'd be nice to not use fixed at all given we don't actually want an overlay. We want sticky DOM sections with a scrollable <main>.)

@benalleng
Copy link
Contributor Author

benalleng commented Apr 3, 2024

I found this writeup https://www.freecodecamp.org/news/fixed-side-and-bottom-navbar-with-css-flexbox/ which involves making the parent wrapper, in our case, the <div id"__next"> have overflow-y:hidden and then the footer be a flex item at the bottom. This does allow us to avoid fixed or sticky postioning but I still need to work a little on refactoring the css as the <main> element needs overflow: auto;

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

Successfully merging a pull request may close this issue.

2 participants