Skip to content

Fix RichTextInput does not allow nesting unordered and ordered lists#11179

Merged
slax57 merged 1 commit intomarmelab:masterfrom
frlruehle:fix-allow-nesting-different-list-types
Mar 4, 2026
Merged

Fix RichTextInput does not allow nesting unordered and ordered lists#11179
slax57 merged 1 commit intomarmelab:masterfrom
frlruehle:fix-allow-nesting-different-list-types

Conversation

@frlruehle
Copy link
Copy Markdown
Contributor

Problem

Issue #11178

Solution

Finding innermost list type for toggling the buttons.

How To Test

Go to react demo page and nest ordered into bullet lists and vice versa.
Screenshot from 2026-03-03 20-36-14

Additional Checks

  • [x ] The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@frlruehle frlruehle changed the title fix(ListButtons): fix nested list toggling in rich text editor [RFR]fix(ListButtons): fix nested list toggling in rich text editor Mar 4, 2026
@slax57 slax57 requested a review from Copilot March 4, 2026 08:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes nested ordered/bulleted list toggling in ra-input-rich-text by making list toolbar state/actions target the innermost active list node, addressing issue #11178.

Changes:

  • Update list toggle handler to toggle the selected format directly, and to toggle off the innermost list when unselecting.
  • Replace “last active list in ListValues” detection with a selection-based “innermost list” lookup.
  • Add getInnermostListType helper using Tiptap’s findParentNode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ra-input-rich-text/src/buttons/ListButtons.tsx
Comment thread packages/ra-input-rich-text/src/buttons/ListButtons.tsx
Copy link
Copy Markdown
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm, thanks!

@slax57 slax57 added this to the 5.14.4 milestone Mar 4, 2026
@slax57 slax57 merged commit 5a90dde into marmelab:master Mar 4, 2026
16 of 18 checks passed
@slax57 slax57 changed the title [RFR]fix(ListButtons): fix nested list toggling in rich text editor Fix RichTextInput does not allow nesting unordered and ordered lists Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants