[Bug] Creating multiple child element after editing using RTE
Question
Hi All,
I am getting below issues which are related to RTE
- RTE creating multiple child's as action performed on text block. Ex:- suppose we performed same action (Bold) three times in sequence on same text block then its creating three child's on the same element.
- Font action in RTE is only supporting font size values between 1 to 7 so please provide the support for font size values between 1 to 100 in RTE.

NP:- I am using latest version of library but issue is still here so kindly review.
Previous bug for reference https://github.com/artf/grapesjs/issues/1495#issue-368617259 Kindly revert on priority. Thanks in Advance !!!
Answers (3)
Hi All,
Please find step for reproducing this scenario
-
Initial state

-
Perform Bold Action then Italic Action then Underline Action

-
Again click on Bold Action then Italic Action then Underline Action

Actual:- Getting three extra <span> element
Hi All,
rte.add('fontSize', { * icon: `<select class="gjs-field"> * <option>1</option>
* <option>4</option>
* <option>7</option>
* </select>`,
* // Bind the 'result' on 'change' listener
* event: 'change',
* result: (rte, action) => rte.exec('fontSize', action.btn.firstChild.value),
* // Callback on any input change (mousedown, keydown, etc..)
* update: (rte, action) => {
* const value = rte.doc.queryCommandValue(action.name);
* if (value != 'false') { // value is a string
* action.btn.firstChild.value = value;
* }
* }
* })
this block of code is only supporting font size values between 1 to 7 although is should be generic and should be support all integer valuesThis is just how execCommand works and the built-in RTE is based on it. If you need something more sophisticated you can try grapesjs-plugin-ckeditor or implement any other 3rd-party editor by following this guide: https://grapesjs.com/docs/guides/Replace-Rich-Text-Editor.html
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1495
[Bug] Creating multiple child element after editing using RTE
Hi All, I am getting below issues which are related to RTE 1) RTE creating multiple child's as action performed on text block. Ex:- suppose...
Issue #1567
rte toolbar bug
Hello all, I am using the latest grapesjs stable version (40) and I noticed the following bug in the rich text editor: If the user drags an...
Issue #439
unstable
In my machine grapesjs is unstable. Generally at first request throws below error. After refreshing one or two times, it works. Bug exists...
Issue #1137
Cant make Text Block not editable and style able at the same time !
Demo / reproduce problem https://jsfiddle.net/shareefhiasat/u8Lodyh7/1/ Question Not sure if its bug or i dont know how to get the desired...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.