Skip to content

fix(dom): cross-document/iframe support#2043

Merged
atomiks merged 16 commits intomasterfrom
fix/cross-document
Dec 22, 2022
Merged

fix(dom): cross-document/iframe support#2043
atomiks merged 16 commits intomasterfrom
fix/cross-document

Conversation

@atomiks
Copy link
Copy Markdown
Collaborator

@atomiks atomiks commented Dec 16, 2022

This takes into account the x and y offset of an iframe and its scale.

Fixes #1594
Fixes #1711
Fixes #1869
Fixes #1870

  • Visual snapshots

Any issues? Added nesting support, tests for both inside vs. outside + nesting. Seems to work with limitShift as well.

@mishushakov
@talldan
@ciampo
@seahindeniz

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 16, 2022

Deploy Preview for vibrant-gates-22c214 canceled.

Name Link
🔨 Latest commit 8c47deb
🔍 Latest deploy log https://app.netlify.com/sites/vibrant-gates-22c214/deploys/63a41dd9dcb6400008daab19

@rollingversions
Copy link
Copy Markdown

rollingversions bot commented Dec 16, 2022

@floating-ui/dom (1.0.12 → 1.1.0)

Refactors

  • fix: support cross-document anchoring, where if floating element is in a higher-level window than the reference element, the positioning takes this into account (i.e. reference element is inside an iframe, but the floating element isn't)

    Bumping minor version because if you were adding external code/custom middleware to add support yourself, it will break with this update as it's no longer necessary.

Packages With No Changes

The following packages have no user facing changes, so won't be released:

  • @floating-ui/core
  • @floating-ui/react
  • @floating-ui/react-dom
  • @floating-ui/react-native
  • @floating-ui/vue

Edit changelogs

Change log has not been updated since latest commit Update Changelog

@atomiks atomiks mentioned this pull request Dec 17, 2022
18 tasks
@atomiks atomiks merged commit ad87249 into master Dec 22, 2022
@atomiks atomiks deleted the fix/cross-document branch December 22, 2022 09:22
@ciampo
Copy link
Copy Markdown

ciampo commented Jan 2, 2023

Hey @atomiks, is this fix already included in the latest version of the @floating-ui/dom package (i.e 1.1.0) ?

I gave it a quick look and it doesn't seem to fix the issues that we were trying to fix in https://github.com/WordPress/gutenberg/

@atomiks
Copy link
Copy Markdown
Collaborator Author

atomiks commented Jan 2, 2023

Hey yeah it's in 1.1.0. Can you take a look at the iframe visual tests and see if it's missing a particular case which causes it to not work?

@ciampo
Copy link
Copy Markdown

ciampo commented Jan 2, 2023

I'm not quite sure — I gave a quick look at the visual tests and they seem comprehensive.

I've opened a draft PR WordPress/gutenberg#46845 to hopefully help debugging what's going on.

Would be open to having a chat so that we can more easily discuss the issue at hand? If so, you can find me on the Make WordPress slack as mciampini — I'd love to collaborate and get to the bottom of the cross-document support feature!

@atomiks
Copy link
Copy Markdown
Collaborator Author

atomiks commented Jan 3, 2023

@ciampo yes sure, I'll join soon

@ciampo
Copy link
Copy Markdown

ciampo commented Jan 3, 2023

Awesome! Cc'ing @jsnajdr who is potentially interested in collaborating on this too.

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

Labels

None yet

Projects

None yet

2 participants