@tiptap/core 3.17.1 → 3.18.0
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/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/focus.ts +8 -2
package/dist/index.cjs
CHANGED
|
@@ -681,8 +681,12 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
};
|
|
684
|
-
|
|
685
|
-
|
|
684
|
+
try {
|
|
685
|
+
if (view.hasFocus() && position === null || position === false) {
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
} catch {
|
|
689
|
+
return false;
|
|
686
690
|
}
|
|
687
691
|
if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
|
|
688
692
|
delayedFocus();
|