Skip to content

Bug: Got error Cannot read property of null when using LexicalClickableLinkPlugin and clicking on a non-link element #4514

Closed

Description

@vimutti77

Got error 'Cannot read property of null' when using 'LexicalClickableLinkPlugin' and clicking on a non-link element

Lexical version: 0.10.0

Steps To Reproduce

  1. Go to playground https://playground.lexical.dev
  2. Click on read-only mode.
  3. Click on any element in the editor that is not a link.
  4. See the error in console.

The current behavior

TypeError: Cannot read properties of null (reading 'href')
    at LexicalClickableLinkPlugin.dev.js:68:21
    at beginUpdate (Lexical.dev.js:8013:5)
    at updateEditor (Lexical.dev.js:8104:5)
    at LexicalEditor.update (Lexical.dev.js:10810:5)
    at HTMLDivElement.onClick (LexicalClickableLinkPlugin.dev.js:57:21)

The expected behavior

No error in console

Activity

  1. changed the title [-]Bug: Got error 'Cannot read property of null' when using 'LexicalClickableLinkPlugin' and clicking on a non-link element[/-] [+]Bug: Got error `Cannot read property of null` when using `LexicalClickableLinkPlugin` and clicking on a non-link element[/+] on May 18, 2023
  2. added a commit that references this issue on May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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