Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

[FRONT-626] Fix popover positioning in Safari when zoomed by pinching #2837

Conversation

lowiebenoot
Copy link
Collaborator

@lowiebenoot lowiebenoot commented Jan 8, 2024

Description

Popover positioning is incorrect in Safari when you zoomed by pinching on the trackpad (or on iOS).

I found that floating-ui had the same issue a long time ago and they solved it by checking the user agent. It's not great, but there's no other solution I'm afraid (Safari just does it different/wrong 🤷‍♂️).

I tried replacing our popover with the Radix-ui popover, but radix doesn't allow you to disable the focus trap on the popover, which we need to fully support our current popover.

Manual check

To manual check this, you can't just open the popover story because that runs in an iframe. You need to open the actual iframe to test it out correctly. For example: http://localhost:3000/iframe.html?viewMode=docs&id=mid-level-blocks-popover--docs

…he popover

Otherwise it can be positioned wrongly after zooming by pinching
lorgan3
lorgan3 previously approved these changes Jan 8, 2024
qubis741
qubis741 previously approved these changes Jan 8, 2024
farazatarodi
farazatarodi previously approved these changes Jan 8, 2024
jelledc
jelledc previously approved these changes Jan 8, 2024
@lowiebenoot
Copy link
Collaborator Author

Saw that we had the same issue for the Menu component, so fixed it there as well.

@lowiebenoot lowiebenoot merged commit 87793d6 into next-release Jan 9, 2024
10 checks passed
@lowiebenoot lowiebenoot deleted the FRONT-626-fix-popover-positioning-in-safar-after-pinch-and-zoom branch January 9, 2024 10:59
@lowiebenoot lowiebenoot mentioned this pull request Jan 9, 2024
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 this pull request may close these issues.

5 participants