-
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
Fix: New block editor z-index issue. Link options are hidden at the bottom of the page #63809
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. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Rishit30G! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
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 the PR! I see this change is per the suggestion in #63795. This works but the z-index
isn’t required in all contexts so applying it in the component’s own styles may necessitate overriding it in other contexts.
In the earlier issue on the bug #62998, I had made this suggestion:
.edit-post-layout.has-metaboxes .edit-post-visual-editor {
z-index: 1;
}
This way the z-index
is applied by a parent context. That would go in this file: https://github.com/WordPress/gutenberg/blob/trunk/packages/edit-post/src/components/layout/style.scss
Hey @stokesman, On setting |
That’s a great catch. Setting the Here’s a screen capture demo: yoast-metabox-v-isolation.mp4Still, I suppose there is some potential issue with that if there is some plugin creating a sort of popover like UI from within the metabox area that overlays the editor canvas or other parts of the editor interface. By making the metabox area a stacking context all elements within it can’t be in front of anything the metabox area is not in front of. So I'm not sure what the best idea is here. Perhaps @t-hamano or @talldan have a helpful thought on this. I pushed a commit that applies the |
I think the ideal approach would be to use .edit-post-layout__metaboxes {
isolation: isolate;
}
.edit-post-layout.has-metaboxes .edit-post-visual-editor {
z-index: z-index(".edit-post-layout.has-metaboxes .edit-post-visual-editor");
}
Does this mean that, for example, if we render a popover inside the metabox, any part that extends above the metabox will be clipped? |
Yes. Though only when the element is inside the DOM tree of the metabox. If a plugin were using I suppose the potential issue could be guarded against with .edit-post-layout__metaboxes:focus-within {
z-index: 1;
} Though, now I'm thinking Aki’s initial idea #62998 (comment) for resolving this may be the best. That is to make a shared ancestor of the visual editor and the metabox area a stacking context instead of the visual editor. |
I tried this approach in #63939. |
Hi @Rishit30G, This issue has been resolved in #63939. Of course, you have been added as a co-author to the props. I would like to close this PR, but thank you for your efforts! |
What?
PR is intended to fix this issue: #63795
Why?
When you are editing text in the new block editor if your text is on the bottom of the page and you are trying to add/edit a link, the options are hidden if you have some options for example seo options
How?
Added
z-index: 5
to.editor-visual-editor
as per the suggestionTesting Instructions
Works as expected, the results are now no more blocked by the box below the text
Screenshots or screencast