niuware / mui-rte

Material-UI Rich Text Editor and Viewer
MIT License
432 stars 168 forks source link

How to create a key command for the link control #281

Open islalobo opened 2 years ago

islalobo commented 2 years ago

Checklist

Description

We were able to create custom key commands for each of the controls we are using with either togglBlockType or toggleInlineStyle. However, trying to toggle the link control with a key command has not been working

{
  key: 55, // 7
  name: 'toggle-unordered-list',
  callback: (editorState) => {
    const newState = RichUtils.toggleBlockType(editorState, 'unordered-list-item');
    return newState;
  },
},