Skip to content
Discussion options

You must be logged in to vote

Here's what finally worked for me:

The plugin:

import { createPluginFactory } from "@udecode/plate";
import Cut from "./Cut";
import { onKeyDownToggleWrapNodes } from "../../../common/plate/inlineWrap/onKeyDownToggleInline";

export const ELEMENT_CUT = "cut";

export interface CutPlugin {}

export const createCutPlugin = createPluginFactory<CutPlugin>({
  key: ELEMENT_CUT,
  isElement: true,
  isInline: true,
  component: Cut,
  handlers: {
    onKeyDown: onKeyDownToggleWrapNodes, // custom key down handler i had to write
  },
  options: {
    hotkey: ["mod+shift+q"],
  },
});

The custom key down handler:

import {
  Value,
  PlateEditor,
  KeyboardHandlerReturnType,
  getPluginType,
  to…

Replies: 3 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
14 replies
@jelling
Comment options

@12joan
Comment options

@jelling
Comment options

@jelling
Comment options

@jelling
Comment options

Comment options

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