@cocreate/cursors 1.11.4 → 1.11.5

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.5](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.4...v1.11.5) (2022-01-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * if parent position is static add relative to contain cursor-container ([76f23c1](https://github.com/CoCreate-app/CoCreate-cursors/commit/76f23c1520fdc270f325885332ccf67bab6787ed))
7
+
1
8
  ## [1.11.4](https://github.com/CoCreate-app/CoCreate-cursors/compare/v1.11.3...v1.11.4) (2022-01-01)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cursors",
3
- "version": "1.11.4",
3
+ "version": "1.11.5",
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
@@ -98,6 +98,13 @@ function drawCursors(selection) {
98
98
  mirrorDiv.contentEditable = false;
99
99
  mirrorDiv.element = element;
100
100
  element.insertAdjacentElement('afterend', mirrorDiv);
101
+ let parent = element.parentElement;
102
+ let parentComputed = getComputedStyle(parent);
103
+ // let parentStylePosition = parent.style.position;
104
+ let parentStylePosition = parentComputed['position'];
105
+ if (parentStylePosition == 'static')
106
+ parent.style.position = 'relative';
107
+
101
108
  _initEvents(element);
102
109
  initDocument(document);
103
110
  }