@cocreate/cursors 1.11.16 → 1.11.17

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.11.17](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.16...v1.11.17) (2022-04-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * activeCursor element defined on window object ([c571c2d](https://github.com/CoCreate-app/CoCreate-cursors/commit/c571c2d707fc87d866c027753ffdbc9ea7eea498))
7
+
1
8
  ## [1.11.16](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.15...v1.11.16) (2022-03-22)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.11.16",
3
+ "version": "1.11.17",
4
4
  "description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",
5
5
  "keywords": [
6
6
  "cursors",
package/src/index.js CHANGED
@@ -58,8 +58,7 @@ function drawCursors(selection) {
58
58
  elements = document.querySelectorAll(selector);
59
59
  }
60
60
  for (let element of elements) {
61
- if (element.activeElement && selection.clientId == clientId) {
62
- // element.activeElement = '';
61
+ if (window.activeElement == element && selection.clientId == clientId) {
63
62
  continue;
64
63
  }
65
64
  let realtime = element.getAttribute('realtime');
@@ -73,8 +72,8 @@ function drawCursors(selection) {
73
72
  if (element.hasAttribute('contenteditable')) {
74
73
  let domTextEditor = element;
75
74
  if (element.tagName == 'IFRAME'){
76
- let frameClientId = element.contentDocument.defaultView.CoCreateSockets.clientId;
77
- if (frameClientId == selection.clientId) continue;
75
+ // let frameClientId = element.contentDocument.defaultView.CoCreateSockets.clientId;
76
+ // if (frameClientId == selection.clientId) continue;
78
77
  domTextEditor = element.contentDocument.documentElement;
79
78
  }
80
79
  let pos = getElementPosition(domTextEditor.htmlString, start, end);