Issue #3319πŸ’¬ AnsweredOpened Mar 5, 2021by anatoli-dp0 reactions

Layers text does not center after creating a new line

Quick answerby artf

Ok, I'll push a fix for the editing of layers name, probably it doesn't make sense having new lines enabled there (I'll make stop the editing on Enter/Esc). For the second issue, If you're using something yours to resize the canvas, probably you should call editor.refresh() to adjust the toolbar

Read full answer below ↓

Question

Version: current? You can get the version by typing grapesjs.version into the console Are you able to reproduce the bug from the demo? [ ] Yes [ x] No // to be fair never tried in the demo What is the expected behavior? when editing the layers text and adding a new line then backspacing i would expect the edited text to be recentered Describe the bug detailed the text does not recenter but is raised (please see attatched image) What is the current behavior? text is raised above the center after pressing enter to start a new line and then backspacing out of the line. however completely clearin...

Answers (3)

artfβ€’ Mar 12, 2021

Ok, I'll push a fix for the editing of layers name, probably it doesn't make sense having new lines enabled there (I'll make stop the editing on Enter/Esc). For the second issue, If you're using something yours to resize the canvas, probably you should call editor.refresh() to adjust the toolbar

anatoli-dpβ€’ Mar 12, 2021

yeah I didn't realize editor.refresh() was a thing until after. otherwise thanks. awesome project

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @anatoli-dp. Great question about layers text does not center after creating a new line. The recommended approach with Canvas is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.