-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Zoom out: Disable 'Desktop (50%)' option in the non-iframed editor #64264
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +21 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
{ | ||
// The "Desktop (50%)" option only works in the iframe editor, | ||
// so disable it in the non-iframe editor. | ||
! disableIframe && { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zoom-out should generally be disabled if there's no iframe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get this value of disableIframe without passing it down in props?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might also need to disable the experimental zoomed-out view when the pattern category is selected and the editor is not an iframe, otherwise we'll be forcing "Desktop (50%)" even though it's not in the view options:
8ac90c830538f13f8d330a5810987d3b.mp4
Perhaps we need to know whether the editor is an iframe or not here, is there a way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. This fixes the bug and looks good to me.
This does fix the UI issue when the Zoom Out experiment is not enabled but I wonder if it’d be possible to instead force the iframe editor when Zoom Out engages as happens when editing the template or template part. If so it would also fix #62943. |
Thanks for the feedback! I think this approach is very simple and makes perfect sense. I've submitted #64316. |
Thank you everyone for your reviews. I think it makes sense to ship #64316, so I'm going to close this PR. |
Fixes #64259
What?
This PR will disable the "Desktop (50%)" option if the editor is not iframed.
Why?
The "Desktop (50%)" view is a zoom-out mode. The zoom-out mode does not work properly if the editor is not an iframe.
From my understanding, it is difficult or requires significant modifications to make the zoom-out mode work in a non-iframe editor. Therefore, I think it is best to leave it disabled for now.
How?
We can determine if the editor is an iframe by checking the
disableIframe
. If this istrue
, exclude the "Desktop (50%)" option.Testing Instructions
This option is available if the custom field is disabled, otherwise it should not be visible.