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

[Bug] Creating multiple child element after editing using RTE

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, 20180 reactions

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, 20180 reactions

Hi All,

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

Code SnippetTEXT
*         <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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.