How to use the medium-editor.default.util function in medium-editor

To help you get started, we’ve selected a few medium-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomchentw / medium-editor-tc-mention / src / index.js View on Github external
handleKeyup(event) {
    const keyCode = MediumEditor.util.getKeyCode(event);
    const isSpace = keyCode === MediumEditor.util.keyCode.SPACE;
    this.getWordFromSelection(event.target, isSpace ? -1 : 0);

    if (!isSpace && this.activeTriggerList.indexOf(this.trigger) !== -1 && this.word.length > 1) {
      this.showPanel();
    } else {
      this.hidePanel(keyCode === LEFT_ARROW_KEYCODE);
    }
  },
github tomchentw / medium-editor-tc-mention / src / index.js View on Github external
handleKeyup(event) {
    const keyCode = MediumEditor.util.getKeyCode(event);
    const isSpace = keyCode === MediumEditor.util.keyCode.SPACE;
    this.getWordFromSelection(event.target, isSpace ? -1 : 0);

    if (!isSpace && this.activeTriggerList.indexOf(this.trigger) !== -1 && this.word.length > 1) {
      this.showPanel();
    } else {
      this.hidePanel(keyCode === LEFT_ARROW_KEYCODE);
    }
  },