react-quill icon indicating copy to clipboard operation
react-quill copied to clipboard

Custom link handler opens and closes tooltip immediately

Open OleksandrFomin opened this issue 3 years ago • 2 comments

I'm trying to open the tooltip to customize the link and bit closes down immediately. What could be the problem?

 toolbar: {
      container: ['bold', 'italic', { list: 'bullet' }, 'link'],
      handlers: {
        link: () => {
          const editor = reactQuillRef.getEditor();
          const unprivilegedEditor = reactQuillRef.makeUnprivilegedEditor(
            editor,
          );
          const range = unprivilegedEditor.getSelection();

          if (range == null || range.length == 0) {
            alert('nothing is selected');
            return;
          }
          const tooltip = editor.theme.tooltip;

          tooltip.edit('link');
        },
      },
    },

OleksandrFomin avatar Nov 16 '21 16:11 OleksandrFomin

In fact, this happens with the regular link if I add any kind of custom handler. Even if it's empty

   handlers: {
        any: value => {
        },
      },

OleksandrFomin avatar Nov 17 '21 12:11 OleksandrFomin

Same problem... Any news?

erbsutil avatar Apr 20 '22 17:04 erbsutil