Skip to content

IndentPlugin fails to indent selected blocks #4779

@OmarSalouss

Description

@OmarSalouss

Description

When selecting an entire block element (e.g., a code block, paragraph, quote) and pressing Tab, the expected indentation behavior from IndentPlugin does not occur.
Instead, the browser moves focus out of the editor, as if the Tab key is not being handled by Plate.

Inline indentation (cursor inside text) works correctly — the issue is specific to block-level selection.

This behavior appears inconsistent with the documentation:
https://platejs.org/docs/indent

Expected Behavior

  • When a block is selected and the user presses Tab, Plate should:

    • Handle the key event
    • apply block indentation using IndentPlugin
    • prevent the browser from moving focus away

Actual Behavior

  • When a block is selected:

    • Pressing Tab does nothing to the block
    • Focus leaves the editor
    • No indentation is applied
    • The plugin’s indent logic is not triggered

The screenshot below shows how I select the entire block element before pressing Tab to reproduce the issue.

Image

Reproduction URL

No response

Reproduction steps

1. Enable `IndentPlugin` in a Plate editor.
2. Insert a block element (tested with: code block, paragraph, blockquote).
3. Select the entire block — **not** place the cursor inside it.
4. Press **Tab**.
5. Observe: focus moves out of the editor and no indentation occurs.

Plate version

49.2.21

Slate React version

0.117.4

Screenshots

Logs

Browsers

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions