Skip to content

fix(richtext-lexical): allow to indent children even if their parents are not indentable #12042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

tak-amboss
Copy link
Contributor

What?

Allows to indent children in richtext-lexical if the parent of that child is not indentable. Changes the behavior introduced in #11739

Why?

If there is a document structure with e.g. tableNode > list > listItem and indentation of tableNode is disabled, it should still be possible to indent the list items.

How?

Disable the indent button only if indentation of one of the selected nodes itself is disabled.

Copy link
Contributor

@GermanJablo GermanJablo left a comment

Choose a reason for hiding this comment

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

Makes sense. Thank you!

@GermanJablo GermanJablo enabled auto-merge (squash) April 8, 2025 14:31
auto-merge was automatically disabled April 15, 2025 11:37

Head branch was pushed to by a user without write access

@tak-amboss tak-amboss force-pushed the fix-allow-indenting-children branch from 9301439 to 700a8e1 Compare April 15, 2025 11:37
@GermanJablo GermanJablo merged commit babf4f9 into payloadcms:main Apr 15, 2025
76 checks passed
Copy link
Contributor

🚀 This is included in version v3.35.0

GermanJablo pushed a commit that referenced this pull request Apr 23, 2025
…lected node allows it (#12182)

### What?
Enables the indent/outdent button if at least one selected node can be
indented/outdented.

### Why?
Before, the buttons were disabled e.g. if multiple nodes were selected
of which one was not indentable/outdentable or if a child node was not
indentable but the parent was, leading to inconsistent behavior.

### How?
Checks if the node itself or any parent fulfills the criteria. The
change affects only the buttons active state, not the actual indentation
logic.

Fixes #12042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants