Skip to content

Bug: Collapsed selections expand to nearest HTML tags on link insertion #5305

Open
@geryogam

Description

@geryogam

Lexical version: v0.12.4

Steps to reproduce

  1. Go to https://playground.lexical.dev/.
  2. Click (not select) on the word ‘typing’ (you should see the text cursor blinking, a.k.a. a collapsed selection).
  3. Click on the ‘Insert link’ button.

The current behavior

The collapsed selection expands to the nearest HTML tags:

. Try typing in

The expected behavior

The collapsed selection should only expand to the current word:

typing

or (another solution) nothing should happen at all for collapsed selections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hyperlinksRelates to Lexical Links

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions