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

SPT Preview - editor crashes with 'getBoundingClientRect of undefined' error on 8.5-alpha+ #44038

Closed
Addison-Stavlo opened this issue Jul 9, 2020 · 3 comments

Comments

@Addison-Stavlo
Copy link
Contributor

Addison-Stavlo commented Jul 9, 2020

I am not able to reproduce this on Gutenberg v8.3, but currently ran into this problem on edge sites. Sometimes (more rarely) it is triggered just by opening the SPT Layout Picker. But more consistently reproducible by:

  • Navigate to the editor on an edge stickered site.
  • Load the layout picker ('Change layout' button on the right document bar)
  • Select 'Dalston' layout (this is only reproducible with certain layouts)
  • Click the large preview on the right.
  • hit 'Tab'

Notice the editor breaks with an error:

Screen Shot 2020-08-13 at 11 22 53 AM

@Addison-Stavlo
Copy link
Contributor Author

Addison-Stavlo commented Jul 9, 2020

After investigating further the error seems to be coming from the core Popover component, @andrewserong had some thoughts:.

it looks or feels like there's a Popover somewhere that's trying re-adjust its size, and I'm wondering if somehow the block provider expects there to be a Popover.Slot — or because our parent document's block provider has one, it's somehow expecting something like that here?

  • I did experiment with adding a Popover.Slot and SlotFillProvider but that didn't seem to change anything.
  • I can add a handful of ?. conditions to the Popover component to stop the error on my local setup, but this seems to be more of a bandaid and none of those seem to correspond to recent changes within the file itself.
  • I tried replacing the custom BlockPreview used in SPTs with the core version, but the error persists in that case as well.
  • It seems most (but not all) of the Layouts that trigger this error have links/CTA Buttons near the top.

@Addison-Stavlo
Copy link
Contributor Author

Repeating myself on this thread for visibility:

I have an unconfirmed suspicion that this may be fixed by WordPress/gutenberg#24397 which was created to fix a similar tabbing through previews issue - #44042 . That fix is included with 8.8 which I believe should be live on edge sites early next week, so it may be worth testing this issue again once that is live.

@david-szabo97
Copy link
Contributor

Fixed in Gutenberg v8.9 by WordPress/gutenberg#24935

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.

3 participants