Issue #5312Opened August 17, 2023by srinivas9770 reactions

BUG: Issue with rich text editor Indent action for Lists

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Chrome V115

Reproducible demo link

https://jsfiddle.net/srinivas977/ahgLxv6e/10/

Describe the bug

How to reproduce the bug?

  1. In the provided JSFiddle, include a pair of text lines and select lists. Next, append a sub-list, and then add the sub-list. Afterward, clicking outside the chosen element causes one of the items in the sub-list to vanish.

The occurrence is also visible in this video link(notice it from 30th second in the video):

https://github.com/GrapesJS/grapesjs/assets/49796104/59de9aa5-5f3f-43ae-9ed1-358b86ac8b27

What is the expected behavior?

  1. The items within the sub-list must not vanish.
  2. Upon selecting the indent action, it is automatically assigned the same type (ordered/unordered list) as its parent list by default, which results in invalid HTML. Example: Element 'ol' not allowed as child of element 'ol'

What is the current behavior?

  1. The items in the sub-list are vanishing
  2. It should validate the HTML and assign the corresponding (ordered/unordered list tag) based on the parent tag ...

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (1)

artfAugust 23, 20230 reactions

Unfortunately, as the default implementation relies on the deprecated execCommand, there are too many edge cases to handle and it isn't worth spending time on it anymore. I'd suggest relying on it only for basic formatting (eg. bold, italic, underline, etc.), for more complex elements I'd highly recommend creating custom components or replacing the built-in Rich Text Editor.

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.