@tiptap/core 2.0.0-beta.142 → 2.0.0-beta.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -527,7 +527,11 @@ function resolveSelection(state, position = null) {
527
527
  to: position,
528
528
  };
529
529
  }
530
- const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
530
+ const focus = (position = null, options) => ({ editor, view, tr, dispatch, }) => {
531
+ options = {
532
+ scrollIntoView: true,
533
+ ...options,
534
+ };
531
535
  const delayedFocus = () => {
532
536
  // focus within `requestAnimationFrame` breaks focus on iOS
533
537
  // so we have to call this
@@ -539,7 +543,9 @@ const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
539
543
  requestAnimationFrame(() => {
540
544
  if (!editor.isDestroyed) {
541
545
  view.focus();
542
- editor.commands.scrollIntoView();
546
+ if (options === null || options === void 0 ? void 0 : options.scrollIntoView) {
547
+ editor.commands.scrollIntoView();
548
+ }
543
549
  }
544
550
  });
545
551
  };