Skip to content

How to define another key with the same Mention plugin? #3702

Closed Answered by zbeyens
bahrijar asked this question in Q&A
Discussion options

You must be logged in to vote

I'd recommend creating a new plugin using https://platejs.org/docs/combobox.

For example:

export type SmartDataChipConfig = PluginConfig<
  'smart_data_chip',
  TriggerComboboxPluginOptions,
  {},
  {
    insert: {
      smartDataChip: (options: { search: string; value: any }) => void;
    };
  }
>;

export const SmartDataChipInputPlugin = createPlatePlugin({
  key: 'smart_data_chip_input',
  node: { isElement: true, isInline: true, isVoid: true },
});

export const SmartDataChipPlugin = createTPlatePlugin<SmartDataChipConfig>({
  key: 'smart_data_chip',
  extendEditor: withTriggerCombobox,
  node: { isElement: true, isInline: true, isMarkableVoid: true, isVoid: true },
  options: {
    t…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@abhi-bc
Comment options

@bahrijar
Comment options

Answer selected by bahrijar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants