@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.
- package/dist/packages/core/src/commands/focus.d.ts +3 -1
- package/dist/tiptap-core.cjs.js +8 -2
- package/dist/tiptap-core.cjs.js.map +1 -1
- package/dist/tiptap-core.esm.js +8 -2
- package/dist/tiptap-core.esm.js.map +1 -1
- package/dist/tiptap-core.umd.js +8 -2
- package/dist/tiptap-core.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/focus.ts +16 -3
package/dist/tiptap-core.umd.js
CHANGED
|
@@ -525,7 +525,11 @@
|
|
|
525
525
|
to: position,
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
|
-
const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
|
|
528
|
+
const focus = (position = null, options) => ({ editor, view, tr, dispatch, }) => {
|
|
529
|
+
options = {
|
|
530
|
+
scrollIntoView: true,
|
|
531
|
+
...options,
|
|
532
|
+
};
|
|
529
533
|
const delayedFocus = () => {
|
|
530
534
|
// focus within `requestAnimationFrame` breaks focus on iOS
|
|
531
535
|
// so we have to call this
|
|
@@ -537,7 +541,9 @@
|
|
|
537
541
|
requestAnimationFrame(() => {
|
|
538
542
|
if (!editor.isDestroyed) {
|
|
539
543
|
view.focus();
|
|
540
|
-
|
|
544
|
+
if (options === null || options === void 0 ? void 0 : options.scrollIntoView) {
|
|
545
|
+
editor.commands.scrollIntoView();
|
|
546
|
+
}
|
|
541
547
|
}
|
|
542
548
|
});
|
|
543
549
|
};
|