facebook / facebook/lexical

Bug: `ListMaxIndentLevelPlugin` allows indent beyond `maxDepth` on paste

Open
#5,170 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 16h
Merged PRs (30d)
61

Description

The playground has a max depth of 7 for list indents but you can bypass it by pasting the indents as shown in the screen recording

https://github.com/facebook/lexical/assets/54323745/594036f3-5ffb-43ea-8a84-3bc72bd49ad7

Lexical version: `0.12.2`

## Steps To Reproduce

1. Go to https://playground.lexical.dev/ it has indent maxDepth of 7
2. Paste indented list having depth more than 7, you'll be able to paste it successfully

## The current behavior
maxDepth for `ListMaxIndentLevelPlugin` only stops directly indenting lists in the editor

## The expected behavior
Even when pasting indented content it should still adhere to maxDepth by the editor, it should remove those extra indents.

Contributor guide

Open the contributing guide

Research direction

Start in the playground at playground.lexical.dev and inspect ListMaxIndentLevelPlugin, using the reproduction steps to paste a list deeper than seven levels. Trace the paste handling related to list indentation and verify that pasted content no longer exceeds maxDepth 7, while direct indentation continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.