suneditor icon indicating copy to clipboard operation
suneditor copied to clipboard

Context Menu Implementation

Open megamind2301 opened this issue 6 years ago • 1 comments

Hi, I have integrated SunEditor in my react project. I need to implement custom context menu on right click. But there is no event handler for the same (Neither onMouseDown nor onContextMenu). Can it be implemented manually, if need be?

megamind2301 avatar Apr 30 '20 12:04 megamind2301

Hi @Megamind2301

You can use the onMouseDown or onClick. And it may be helpful to refer to the code in submenuOn and controllersOn.

const editor = suneditor.create(..);
editor.onMouseDown = function (e, core) {
  core.controllersOff();
  // Edit contextMenuDiv
  const menu;
  core.controllersOn(menu);
}

JiHong88 avatar May 04 '20 15:05 JiHong88