@blocknote/core 0.4.6-alpha.3 → 0.4.6-alpha.4

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@blocknote/core",
3
- "homepage": "https://github.com/yousefed/blocknote",
3
+ "homepage": "https://github.com/TypeCellOS/BlockNote",
4
4
  "private": false,
5
5
  "license": "MPL-2.0",
6
- "version": "0.4.6-alpha.3",
6
+ "version": "0.4.6-alpha.4",
7
7
  "files": [
8
8
  "dist",
9
9
  "types",
@@ -109,5 +109,5 @@
109
109
  "access": "public",
110
110
  "registry": "https://registry.npmjs.org/"
111
111
  },
112
- "gitHead": "5e0103855c5d5c15237eb6aa05db23cfb25b23eb"
112
+ "gitHead": "4ec9f17bdaa504a53eb080909e0e6c22ba071b61"
113
113
  }
@@ -38,6 +38,12 @@ function getDraggableBlockFromCoords(
38
38
  coords: { left: number; top: number },
39
39
  view: EditorView
40
40
  ) {
41
+ if (!view.dom.isConnected) {
42
+ // view is not connected to the DOM, this can cause posAtCoords to fail
43
+ // (Cannot read properties of null (reading 'nearestDesc'), https://github.com/TypeCellOS/BlockNote/issues/123)
44
+ return undefined;
45
+ }
46
+
41
47
  let pos = view.posAtCoords(coords);
42
48
  if (!pos) {
43
49
  return undefined;