Issue #1502💬 AnsweredOpened October 11, 2018by mudit-mittal0 reactions

Creating multiple child element after editing using RTE

快速解答by mudit-mittal

Hi All, Please find step for reproducing this scenario 1) Initial state 2) Perform Bold Action then Italic Action then Underline Action 3) Again click on Bold Action then Italic Action then Underline Action Actual:- Getting three extra <span> element

Read full answer below ↓

Question

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 we performed same action (Bold) three times in sequence on same text block then its creating three child's on the same element.
  2. 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.

image

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)

mudit-mittalOctober 12, 2018

Hi All,

Please find step for reproducing this scenario

  1. Initial state image

  2. Perform Bold Action then Italic Action then Underline Action image

  3. Again click on Bold Action then Italic Action then Underline Action image

Actual:- Getting three extra <span> element

mudit-mittalOctober 12, 2018

Hi All,

rte.add('fontSize', { * icon: `<select class="gjs-field"> * <option>1</option>

代码片段TEXT
*         <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 values

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.