@dxos/react-ui-editor 0.6.13-main.548ca8d → 0.6.13-main.ed424a1
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/lib/browser/index.mjs +14 -1
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +14 -1
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +14 -1
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/hooks/useTextEditor.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/TextEditor.stories.tsx +3 -3
- package/src/hooks/useTextEditor.ts +7 -2
@@ -5268,7 +5268,7 @@ var useTextEditor = (props = {}, deps = []) => {
|
|
5268
5268
|
}
|
5269
5269
|
const state2 = EditorState2.create({
|
5270
5270
|
doc: initialValue,
|
5271
|
-
selection: initialSelection,
|
5271
|
+
// selection: initialSelection,
|
5272
5272
|
extensions: [
|
5273
5273
|
id && documentId.of(id),
|
5274
5274
|
extensions,
|
@@ -5321,6 +5321,19 @@ var useTextEditor = (props = {}, deps = []) => {
|
|
5321
5321
|
parentRef.current?.removeAttribute("data-tabster");
|
5322
5322
|
}
|
5323
5323
|
if (scrollTo || selection) {
|
5324
|
+
if (selection && selection.anchor > view.state.doc.length) {
|
5325
|
+
log8.warn("invalid selection", {
|
5326
|
+
length: view.state.doc.length,
|
5327
|
+
scrollTo,
|
5328
|
+
selection
|
5329
|
+
}, {
|
5330
|
+
F: __dxlog_file11,
|
5331
|
+
L: 149,
|
5332
|
+
S: void 0,
|
5333
|
+
C: (f, a) => f(...a)
|
5334
|
+
});
|
5335
|
+
return;
|
5336
|
+
}
|
5324
5337
|
view.dispatch(createEditorStateTransaction(view.state, {
|
5325
5338
|
scrollTo,
|
5326
5339
|
selection
|