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

BlockToolbar looses its position and width #6570

Closed
panr opened this issue Apr 7, 2020 · 2 comments · Fixed by ckeditor/ckeditor5-utils#331 or ckeditor/ckeditor5-ui#554
Closed

BlockToolbar looses its position and width #6570

panr opened this issue Apr 7, 2020 · 2 comments · Fixed by ckeditor/ckeditor5-utils#331 or ckeditor/ckeditor5-ui#554
Assignees
Labels
package:ui package:utils type:bug This issue reports a buggy (incorrect) behavior.

Comments

@panr
Copy link
Contributor

panr commented Apr 7, 2020

📝 Provide detailed reproduction steps (if any)

💡This issue has been created before the code got merged and it exists only locally in situation where BlockToolbar has implemented shouldGroupWhenFull.

The issue is needed only as a reference to possibly existing bug and it is related to #6449.

  1. Allow BlockToolbar to group items.
  2. Show toolbar panel.
  3. Hide it.
  4. Show it again.

✔️ Expected result

Toolbar panel should be anchored correctly to the block toolbar button each time.

❌ Actual result

Toolbar panel is anchored correctly only the first time you show it. It resets the position and width only when view has been resized.

issue

@panr panr added the type:bug This issue reports a buggy (incorrect) behavior. label Apr 7, 2020
@oleq
Copy link
Member

oleq commented Apr 7, 2020

This could be either very simple or quite nasty.

I gave it a quick look. There's this moment when the ContextualBalloon shows/hides the toolbar and the native ResizeObserver that manages toolbar grouping kicks in. For some reason the latter figures there's no space for the buttons and it groups them all. Then the positioning algorithm (which probably is not the culprit here) sees a toolbar which is maybe 50px wide (all buttons grouped) and uses the very first position that geometrically makes sense for this kind of squashed toolbar, which is something like north-middle-east.

I didn't go deeper but maybe I'll spend and hour or two to debug this.

@panr
Copy link
Contributor Author

panr commented Apr 9, 2020

Related: #6575

oleq added a commit to ckeditor/ckeditor5-ui that referenced this issue Apr 9, 2020
Feature: The `BlockToolbar` should group items when there is no place to show them all. Closes ckeditor/ckeditor5#6449. Closes ckeditor/ckeditor5#6575. Closes ckeditor/ckeditor5#6570.

Bulletproofed the `ToolbarView#maxWidth` and items grouping when the toolbar is invisible.
oleq added a commit to ckeditor/ckeditor5-utils that referenced this issue Apr 9, 2020
Fix: Do not execute `ResizeObserver` callbacks when the resized element is invisible (but still in DOM) (see ckeditor/ckeditor5#6570).
mlewand pushed a commit that referenced this issue May 1, 2020
Feature: The `BlockToolbar` should group items when there is no place to show them all. Closes #6449. Closes #6575. Closes #6570.

Bulletproofed the `ToolbarView#maxWidth` and items grouping when the toolbar is invisible.
mlewand pushed a commit that referenced this issue May 1, 2020
Fix: Do not execute `ResizeObserver` callbacks when the resized element is invisible (but still in DOM) (see #6570).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui package:utils type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
2 participants