@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.cjs.js
CHANGED
|
@@ -531,7 +531,11 @@ function resolveSelection(state, position = null) {
|
|
|
531
531
|
to: position,
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
|
|
534
|
+
const focus = (position = null, options) => ({ editor, view, tr, dispatch, }) => {
|
|
535
|
+
options = {
|
|
536
|
+
scrollIntoView: true,
|
|
537
|
+
...options,
|
|
538
|
+
};
|
|
535
539
|
const delayedFocus = () => {
|
|
536
540
|
// focus within `requestAnimationFrame` breaks focus on iOS
|
|
537
541
|
// so we have to call this
|
|
@@ -543,7 +547,9 @@ const focus = (position = null) => ({ editor, view, tr, dispatch, }) => {
|
|
|
543
547
|
requestAnimationFrame(() => {
|
|
544
548
|
if (!editor.isDestroyed) {
|
|
545
549
|
view.focus();
|
|
546
|
-
|
|
550
|
+
if (options === null || options === void 0 ? void 0 : options.scrollIntoView) {
|
|
551
|
+
editor.commands.scrollIntoView();
|
|
552
|
+
}
|
|
547
553
|
}
|
|
548
554
|
});
|
|
549
555
|
};
|