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

Remove fixed CSS positioning of fixed BlockContextualToolbar for easier re-use #54109

Open
louwie17 opened this issue Sep 1, 2023 · 0 comments
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

Comments

@louwie17
Copy link
Contributor

louwie17 commented Sep 1, 2023

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 have overflow: 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:
Screenshot 2023-09-01 at 9 15 21 AM

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:

either by SlotFill or as is (when fixed toolbar is selected).

@bph bph added [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 labels Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants