Skip to content

fix: expose divider alignment in style manager - #436

Open
sridharkalaibala wants to merge 1 commit into
GrapesJS:masterfrom
sridharkalaibala:fix/divider-alignment
Open

sridharkalaibala wants to merge 1 commit into
GrapesJS:masterfrom
sridharkalaibala:fix/divider-alignment

Conversation

@sridharkalaibala

@sridharkalaibala sridharkalaibala commented Sep 12, 2026

Copy link
Copy Markdown

Selecting an mj-divider currently hides the existing Align control because align is missing from its stylable properties. Enable it and set the divider's default alignment to center, matching MJML's documented default.

Closes #390.

This uses the existing Style Manager control and style-to-attribute conversion. Explicit left/right alignment is preserved when importing MJML. The center default is omitted from exported MJML through the existing default-attribute handling.

Validation:

  • Seven tests cover control visibility, center selection/default export, left/center/right changes through Style Manager and compiled HTML, and explicitly imported left/right values.
  • Original source: 2 failures and 5 passing controls. Fixed source: all 7 pass.
  • Full suite: 26 tests and 2 existing snapshots pass on Node 24.19.0 and CI's Node 18 family (18.20.8).
  • npm run lint, npx tsc --noEmit, and npm run build pass. Build produces the library, locale files and TypeScript declarations; existing bundle-size/Browserslist warnings remain.
  • Chromium using the same built plugin with both locked GrapesJS 0.21.2 and published GrapesJS 0.23.6: center is initially selected; clicking each of left/right/center updates the model, actual divider position in the canvas, and compiled HTML. No runtime errors.

No dependency, lockfile or version changes. AI assistance: implemented and validated with OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"align" option is missing for mj-divider in Style Manager

1 participant