@codemirror/view 6.10.0 → 6.10.1
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 +6 -0
- package/dist/index.cjs +8 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -8352,7 +8352,14 @@ class Placeholder extends WidgetType {
|
|
|
8352
8352
|
}
|
|
8353
8353
|
coordsAt(dom) {
|
|
8354
8354
|
let rects = dom.firstChild ? clientRectsFor(dom.firstChild) : [];
|
|
8355
|
-
|
|
8355
|
+
if (!rects.length)
|
|
8356
|
+
return null;
|
|
8357
|
+
let style = window.getComputedStyle(dom.parentNode);
|
|
8358
|
+
let rect = flattenRect(rects[0], style.direction != "rtl");
|
|
8359
|
+
let lineHeight = parseInt(style.lineHeight);
|
|
8360
|
+
if (rect.bottom - rect.top > lineHeight * 1.5)
|
|
8361
|
+
return { left: rect.left, right: rect.right, top: rect.top, bottom: rect.top + lineHeight };
|
|
8362
|
+
return rect;
|
|
8356
8363
|
}
|
|
8357
8364
|
ignoreEvent() { return false; }
|
|
8358
8365
|
}
|
package/dist/index.js
CHANGED
|
@@ -8345,7 +8345,14 @@ class Placeholder extends WidgetType {
|
|
|
8345
8345
|
}
|
|
8346
8346
|
coordsAt(dom) {
|
|
8347
8347
|
let rects = dom.firstChild ? clientRectsFor(dom.firstChild) : [];
|
|
8348
|
-
|
|
8348
|
+
if (!rects.length)
|
|
8349
|
+
return null;
|
|
8350
|
+
let style = window.getComputedStyle(dom.parentNode);
|
|
8351
|
+
let rect = flattenRect(rects[0], style.direction != "rtl");
|
|
8352
|
+
let lineHeight = parseInt(style.lineHeight);
|
|
8353
|
+
if (rect.bottom - rect.top > lineHeight * 1.5)
|
|
8354
|
+
return { left: rect.left, right: rect.right, top: rect.top, bottom: rect.top + lineHeight };
|
|
8355
|
+
return rect;
|
|
8349
8356
|
}
|
|
8350
8357
|
ignoreEvent() { return false; }
|
|
8351
8358
|
}
|