Remove fixed CSS positioning of fixed BlockContextualToolbar for easier re-use #54109
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Package] Block editor
/packages/block-editor
[Type] Bug
An existing feature does not function as intended
What problem does this address?
After the changes in #49634 got merged, the fixed
BlockContextualToolbar
is using fixed CSS positioning. This actually makes it hard to use the fixed Toolbar outside of the page/post block editor, especially as the parent elements haveoverflow: hidden
set, so using absolute won't work to position it in the document toolbar.For example, WooCommerce is using the editor within a Modal context, where the fixed height isn't totally certain, this made positioning the Toolbar difficult:
It looks like the IsolatedBlockEditor ran into similar problems: Automattic/isolated-block-editor#230 (comment)
Relying on
fixed
in the above would not work, as the modal positioning is slightly different in different browsers.What is your proposed solution?
Instead of using CSS to do this, we should render it within the document toolbar, either as is, or by using a SlotFill if context is still necessary.
Moving it here for example:
gutenberg/packages/edit-post/src/components/header/header-toolbar/index.js
Line 177 in c3cb39d
The text was updated successfully, but these errors were encountered: