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

Recent regression - Site Editor - Spinner component not visible / missing CSS. #28153

Closed
Addison-Stavlo opened this issue Jan 12, 2021 · 5 comments · Fixed by #31010
Closed
Labels
[Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@Addison-Stavlo
Copy link
Contributor

Describe the bug
The loading spinner does not show up as expected in the site editor. It seems to be missing CSS.

Currently - the spinner component is not visible and seems to be missing styles:

Screen Shot 2021-01-12 at 6 19 19 PM

As compared to previously when it did show up, these styles were present:

Screen Shot 2021-01-12 at 6 20 49 PM

I noticed this as a recent regression while testing related to the bug where template parts would not resolve when themes are installed in subdirectories - #28088. Drafted Sunday evening, this PR was showing the spinner. After rebasing master this afternoon, the spinners seem to have disappeared as their CSS is no longer present - so it seems a recent change has caused this.

The specific spinner I have noted comes from

{ ! isPlaceholder && ! isResolved && <Spinner /> }
- but adding other spinner components to blocks in the block-library seems to have the same issue.

@Addison-Stavlo Addison-Stavlo added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Feature] Full Site Editing labels Jan 12, 2021
@Addison-Stavlo
Copy link
Contributor Author

Addison-Stavlo commented Jan 12, 2021

I wonder if it may be related to the new Iframe? #25775 cc @ellatrix @youknowriad if you may have other ideas about what may have caused this.

@ellatrix
Copy link
Member

Sorry for the late reply. What stylesheet should be loaded that isn't loaded right now?

@Addison-Stavlo
Copy link
Contributor Author

Sorry for the late reply.

No worries, thanks for taking a look!

What stylesheet should be loaded that isn't loaded right now?

After poking around briefly, it looks like it is the styles defined in JS that correspond to what were missing in the screenshots above:

display: inline-block;
background-color: ${ color( 'gray.600' ) };
width: ${ config( 'spinnerSize' ) };
height: ${ config( 'spinnerSize' ) };
opacity: 0.7;
margin: 5px 11px 0;
border-radius: 100%;
position: relative;

@ellatrix
Copy link
Member

@ItsJonQ Did you know more about these generated styles and how to insert them into a different document?

@ItsJonQ
Copy link

ItsJonQ commented Feb 9, 2021

Haiii!!! Sorry for the late reply @ellatrix .
Yes! I may be able to help with this.

For these styles, what needs to happen is they need to be rendered in a Provider.
This provider tells them which document to insert their styles into.

Previously, I created a library to help with this exact problem:
https://github.com/ItsJonQ/styled-providers#frameprovider

We can use the same technique for the iFrame editor as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants