How to use the tiptap.TextSelection function in tiptap

To help you get started, we’ve selected a few tiptap 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 apostrophecms / apostrophe / lib / modules / apostrophe-rich-text-widgets / src / apos / tiptap-extensions / Link.js View on Github external
handleClick(view, pos) {
            const { schema, doc, tr } = view.state;
            const range = getMarkRange(doc.resolve(pos), schema.marks.link);

            if (!range) {
              return;
            }

            const $start = doc.resolve(range.from);
            const $end = doc.resolve(range.to);
            const transaction = tr.setSelection(new TextSelection($start, $end));

            view.dispatch(transaction);
          }
        }

tiptap

A rich-text editor for Vue.js

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis