handleScrollToSelection()

in src/plugin/plugin.ts [161:172]


      handleScrollToSelection(view) {
        const selection = view.state.selection;

        let isWithinElement = false;
        view.state.doc.nodesBetween(selection.from, selection.to, (node) => {
          if (isProseMirrorElement(node)) {
            isWithinElement = true;
          }
        });

        return isWithinElement;
      },