#9170·lexical

Feature: Option to disable the AutoEmbedPlugin menu display for specific nodes

Author: levenstaCreated Sep 15, 2026Updated Sep 15, 2026
Labelsenhancement

Description

The existing LexicalAutoEmbedPlugin allows you to display menus and insert certain nodes based on the URL value of embedded AutoLinkNode. For example, the youtube, figma, and x (Twitter) nodes in the playground.

In custom editors, there may be nodes where it is undesirable to display the AutoEmbedPlugin menu and instead leave the original AutoLinkNode as-is. Playground, for example, is a ReviewNode with author slot that is intended to contain only inline elements. Displaying the AutoEmbed menu within this slot bypasses the protection mechanism against block insertion

https://github.com/user-attachments/assets/61e697bd-cb10-4e61-87dd-cda372577e76

To solve this problem, I suggest adding an option to the plugin that accepts an array of predicates: (node: LexicalNode) => boolean. If the inserted autolink node is located within one of the passed nodes — do not display the menu (neither the default nor the overridden one), and do not process the Tab, Enter, or Esc keys when inserting it. As an example for use in the playground, pass predicates that identify nodes from the attribution slot of the PullQuoteNode and the author slot of the ReviewNode

Impact

This adds flexibility when configuring the plugin and allows you to hide the menu for certain irrelevant nodes. Without this configuration, you would have to either copy the plugin's source code or resort to workarounds