Skip to content

Bug: : Missing Support for Nested Numeric Ordered Lists in @lexical/list #7033

Open
@PatrickAfshar

Description

Support for Nested Numeric Ordered Lists (e.g., 1.1, 1.2) Missing in @lexical/list

Issue Description:

The @lexical/list package currently lacks support for nested numeric ordered lists with hierarchical numbering, such as:

  1. First item
    1.1. Sub-item
    1.2. Sub-item
  2. Second item

Instead, nested ordered lists use basic numbering (1, 2, 3) for all levels, without maintaining a hierarchical structure. This is inconsistent with how ordered lists are typically handled in word processors like Microsoft Word or Google Docs, where nested levels follow a 1 → 1.1 → 1.2 → 2 pattern.

Expected Behavior:

Nested ordered lists should support multi-level numeric formatting, similar to Microsoft Word, with the following structure:

  1. First item
    1.1. Sub-item
    1.2. Sub-item
  2. Second item

Each sub-level should increment correctly within the hierarchy.

Current Behavior:
The current implementation only allows simple ordered lists, where all levels use basic numbering (1, 2, 3). For example:

  1. First item
    A. Second item
    B. Third item

This makes it difficult to represent structured documents with nested lists that require numeric hierarchy.

Steps to Reproduce:

  1. Install the @lexical/list package.
  2. Insert an ordered list.
  3. Nest list items to create a second-level list.
  4. Observe that the numbering does not follow a hierarchical pattern.

Why This Feature is Important:

This feature is essential for users creating structured documents with legal references, documentation, academic papers, or outlines, where numeric hierarchy is critical for readability and organization.

Without this feature, Lexical falls behind other rich-text editors that support nested numeric lists by default.

Proposed Solution:

  1. Introduce a new list type (e.g., numeric) that applies hierarchical numbering to ordered lists.
  2. Alternatively, allow customization of list numbering styles for each level.

Environment:

  • Lexical Version: 0.22.0
  • React Version:18
  • Browser:chrome
  • OS:Windows

Additional Context:
This feature is available in most modern text editors, including Microsoft Word, Google Docs, and even Markdown processors that support ordered lists with hierarchical numbering.

Would you like me to search for their GitHub link to help you post this?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions