Skip to content
Discussion options

You must be logged in to vote

I've solved this placing my input button in Toolbar and calling this function on click:

import {
getPluginType,
insertNodes,
PlateEditor,
Value,
withoutNormalizing
} from "@udecode/plate-core";

const VARIABLE_NODE = "variable-node";
export const insertInput = (editor: PlateEditor) => {
withoutNormalizing(editor, () => {

insertNodes<any>(editor, {
  type: getPluginType(editor, VARIABLE_NODE),
  children: [{ text: "" }],
});

});
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Andonee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant