Repository navigation
fix(toolbar): align toolbar with stretched block content - #3058
Anurag-S1ngh wants to merge 8 commits into
Conversation
When a block is stretched, its content spans the full width, but the toolbar stayed aligned to the centered content width. Toggle a stretched modifier on the toolbar and match its content width to the block.
neSpecc
left a comment
There was a problem hiding this comment.
Thanks for the fix, the approach looks right and minimal!
A few things besides the inline comments:
- CHANGELOG: please add an entry to the
2.32.0section ofdocs/CHANGELOG.md, e.g.
`Fix` - Toolbar is now aligned with the content of stretched Blocks - Tests: please add a Cypress test to
test/cypress/tests/api/toolbar.cy.ts:- hovering a stretched block →
.ce-toolbar__contenthas the sameleft/widthas that block's.ce-block__content; - toggling
block.stretchedvia API while the toolbar is open over that block → toolbar re-aligns (see the inline comment).
- hovering a stretched block →
|
All four points are addressed in
The branch is merged with current |
| /** | ||
| * Do not move toolbar if Block Settings or Toolbox opened | ||
| */ | ||
| if (this.Editor.BlockSettings.opened || this.toolboxInstance?.opened) { |
There was a problem hiding this comment.
Checked locally: stretching an image via the Image tool's Stretch tune still leaves the toolbar at the narrow column. The tune keeps Block Settings open after the click, so BlockStretchToggled arrives while settings are open and this early return skips it. Nothing re-applies the class after settings close either. Could you handle this case, e.g. just toggle ce-toolbar--stretched on the wrapper when settings are open (the popover is inside the toolbar and will move with it), or re-sync on Block Settings close? A test for it would be great too.
…toolbar # Conflicts: # docs/CHANGELOG.md
|
Updated the toolbar to apply the stretched modifier before the Block Settings/Toolbox guard, so it realigns immediately while settings stay open. Added a Cypress test covering stretch and unstretch with Block Settings open. Also merged current |
neSpecc
left a comment
There was a problem hiding this comment.
Now "stretch image" tune does nothing, please test it.
|
I could not reproduce this on |
Summary
Stretched blocks render their content across the full width, but the toolbar stayed aligned to the centered content width. The plus button and block tunes appeared far from the block's left edge.
Changes
ce-toolbar--stretchedmodifier inToolbar.moveAndOpen()based on the hovered block'sstretchedstate, and remove it when the toolbar closes.Testing
eslintpasses on the changed file. Stylelint reports only pre-existing indentation errors in these files.Closes #2930