Suneditor: How to disable double click event on pargraph

Created on 8 Mar 2021  路  3Comments  路  Source: JiHong88/SunEditor

Hi JiHong, like the title, i want to disable double click event to prevent some actions unexpected. How can i do that? Thanks

question

All 3 comments

@crying2812 Where do you want to prevent double click?
There are currently no settings for double click.

Register the event yourself like this:

const instance = suneditor.create(..);

instance.onload = (core) => {
  const wysiwygArea = core.options.iframe ? core._ww : core.context.element.wysiwyg;
  const toolbar = core.context.element.toolbar;
  const modal = core.context.dialog.modalArea;

  wysiwygArea.addEventListener('dblclick', (event) => {
    //
  });
}

Thanks for quick response, i want to prevent double click on each paragaph, i will try your way first :D

@crying2812 It may not be possible if you are trying to block the range selection by double click.
It is not blocked by event.preventDefault().

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidkonrad picture davidkonrad  路  4Comments

David-Grass-Feria picture David-Grass-Feria  路  6Comments

chagonzles picture chagonzles  路  4Comments

drnkwati picture drnkwati  路  6Comments

BuiChiBach picture BuiChiBach  路  6Comments