Issue #761✓ SolvedOpened January 15, 2018by gabrigcl7 reactions

Text component problem

Quick answerby Moikapy4

Not sure if I found this code in an Issue on here or on Stack Overflow, but this code here replaces the Divs with a <br/> when you press the enter key. I placed this code in the same file as my grapes-config

Read full answer below ↓

Question

Hi. I wish a text component that do not create new components every time I press "Enter" key to create new paragraphs (this is a bad usability). In addition, the actual text component from the core of grapes has a problem (described in the screencast below). Thanks in advance for your attention! gif-screen-grapes

Answers (3)

👍 Most helpfulMoikapyApril 17, 2019

Not sure if I found this code in an Issue on here or on Stack Overflow, but this code here replaces the Divs with a <br/> when you press the enter key. I placed this code in the same file as my grapes-config

ryandebaJanuary 18, 2018

I looked into this myself a few days ago...apparently there's an insertBrOnReturn option for execCommand, but the browser support is terrible. A solution like this is probably better. @artf How would you want this to change? Should hitting enter insert <br> tags as shown in the top answer on the th...

gabrigclJanuary 18, 2018

I've found a solution to my needs using CKEditor and overriding the native "text" component creating my own. My text component now is a div with a css class that identifies the component: Now, typing ENTER does not create a new component. Nevertheless, this solution do not solve this problem, for t...

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.