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

Navbar links clipping instead of jumping into more menu #2225

Open
corykon opened this issue Sep 13, 2023 · 0 comments
Open

Navbar links clipping instead of jumping into more menu #2225

corykon opened this issue Sep 13, 2023 · 0 comments

Comments

@corykon
Copy link
Collaborator

corykon commented Sep 13, 2023

When an app is loaded in incognito or cache is cleared, you can get in a state where links are clipped instead of jumping into the more menu. The reason is that the calculation is done before the appIcon image is loaded. There's really no reliable way to tell when the image is loaded.

image

Proposed solution: Add an input parameter for raw SVG, which avoids the race condition of the image loading.

Not-so-good possible solutions:

  • [yuck] just tell devs to call navBar?.refreshNavLinks() within a setTimeout and hope you time it right. (not guaranteed and could be jittery)
  • [yuck] add an input parameter for hardocding the navbar image width, that way the more menu calculations don't need to rely on the appIcon image being loaded. (hacky, bug prone if the image size changes and a dev forgets to update)
  • [yuck] write some code that continuously checks the width of the appIcon element until it changes, probably indicating that the image has been rendered

@waldnercharles reported seeing this in a vitalware app. I've seen it sporadically in PopInsights

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

No branches or pull requests

1 participant