@cocreate/cursors 1.11.7 → 1.11.8

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.8](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.7...v1.11.8) (2022-01-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * If element is not contenteditable do not display cursors unless cursors=true ([be7d653](https://github.com/CoCreate-app/CoCreate-cursors/commit/be7d65339d73234f95bbec4400d6ead0adfec9ef))
7
+
1
8
  ## [1.11.7](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.6...v1.11.7) (2022-01-13)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.11.7",
3
+ "version": "1.11.8",
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
@@ -54,7 +54,7 @@ function drawCursors(selection) {
54
54
  let elements = selection.element;
55
55
  if (!elements) {
56
56
  let selector = '[collection="' + collection + '"][document_id="' + document_id + '"][name="' + name + '"]';
57
- selector += ':not(.codemirror, .quill, .monaco, [actions])';
57
+ selector += ':not(.codemirror, .monaco, [actions])';
58
58
  elements = document.querySelectorAll(selector);
59
59
  }
60
60
  for (let element of elements) {
@@ -62,6 +62,11 @@ function drawCursors(selection) {
62
62
  // element.activeElement = '';
63
63
  continue;
64
64
  }
65
+ if (element.tagName != 'INPUT' || element.tagName != 'TEXTAREA'){
66
+ if (!element.hasAttribute('contenteditable') && element.getAttribute('cursors') != 'true') {
67
+ return;
68
+ }
69
+ }
65
70
  let realtime = element.getAttribute('realtime');
66
71
  let cursors = element.getAttribute('cursors');
67
72
  if (realtime == 'false' || cursors == 'false') continue;