@cocreate/text 1.13.2 → 1.13.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.13.3](https://github.com/CoCreate-app/CoCreate-text/compare/v1.13.2...v1.13.3) (2021-11-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sendPosition if no element return ([fec4fbb](https://github.com/CoCreate-app/CoCreate-text/commit/fec4fbb20b574af0995f1f49ad16501a83c52b98))
7
+
1
8
  ## [1.13.2](https://github.com/CoCreate-app/CoCreate-text/compare/v1.13.1...v1.13.2) (2021-11-28)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/text",
3
- "version": "1.13.2",
3
+ "version": "1.13.3",
4
4
  "description": "A simple text component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "text",
package/src/index.js CHANGED
@@ -186,8 +186,9 @@ export function sendPosition (element) {
186
186
  const { start, end } = getSelection(element);
187
187
  if (element.tagName == 'HTML' && !element.hasAttribute('collection') || !element.hasAttribute('collection'))
188
188
  element = element.ownerDocument.defaultView.frameElement;
189
+ if (!element) return;
189
190
  const { collection, document_id, name, isCrdt } = crud.getAttr(element);
190
- if (isCrdt == 'false') return;
191
+ if (isCrdt == 'false' || !collection || !document_id || !name) return;
191
192
  cursors.sendPosition({ collection, document_id, name, start, end });
192
193
  }
193
194