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

Detect iframed editor before enabling Zoom Out feature #65311

Closed
getdave opened this issue Sep 13, 2024 · 5 comments · Fixed by #65452
Closed

Detect iframed editor before enabling Zoom Out feature #65311

getdave opened this issue Sep 13, 2024 · 5 comments · Fixed by #65452
Labels
[Feature] Zoom Out [Type] Bug An existing feature does not function as intended

Comments

@getdave
Copy link
Contributor

getdave commented Sep 13, 2024

We need to detect that the Editor is iframed before we enable/expose the Zoom Out feature to users (even if it's still behind an experiment).


@getdave The easiest step is to enable custom fields, but that might be an issue we already had when the zoom out mode toggle was in a dropdown.

54a730c1ed6c065b2b16ee7fa02421cf.mp4

Originally posted by @t-hamano in #65183 (comment)

@getdave getdave added [Type] Bug An existing feature does not function as intended [Feature] Zoom Out labels Sep 13, 2024
@getdave
Copy link
Contributor Author

getdave commented Sep 13, 2024

@t-hamano if you know how to detect whether the editor is iframed please do let me know otherwise we'll look into it.

@t-hamano
Copy link
Contributor

I haven't explored this in depth yet, but what about forcing an iframe in zoomed-out mode, just like the mobile and tablet views do?

Perhaps it would be a good idea to add a condition __unstableGetEditorMode() === 'zoom-out' to either:

const shouldIframe =
! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType );

disableIframe={ ! shouldIframe }

@t-hamano
Copy link
Contributor

Update: #64351 has been merged, so the logic that determines whether the editor should run as an iframe has been updated. This means that the presence of custom fields/meta boxes is no longer tied to whether the editor is iframed or not.

One way to reproduce this issue is to have the Classic theme and the Jetpack plugin enabled. The Jetpack plugin has custom blocks that are not version 3, which is what prevents the editor from running as an iframe.

@draganescu
Copy link
Contributor

I wonder if we should just disable the experience if there is no iframe?

@getdave
Copy link
Contributor Author

getdave commented Sep 18, 2024

I wonder if we should just disable the experience if there is no iframe?

Yes. That's the purpose of the Issue so I say 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Zoom Out [Type] Bug An existing feature does not function as intended
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants