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?
- 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?
- The items within the sub-list must not vanish.
- 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?
- The items in the sub-list are vanishing
- 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)
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.
Issue #4449
BUG: Lists not working with default RTE
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 102.0.5005.115 (Official Bu...
Issue #6409
BUG: Cannot drag to move components on mobile
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v133 Reproducible demo link https:/...
Issue #5705
BUG: Component tools misalign when the editor is resized
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v122 Reproducible demo link https:/...
Issue #5689
BUG: <> is introduced at the beginning editor.getHtml()
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome Version 121.0.6167.185 (Official Buil...
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.