@codemirror/autocomplete
Advanced tools
Comparing version 0.19.8 to 0.19.9
@@ -0,1 +1,7 @@ | ||
## 0.19.9 (2021-11-26) | ||
### Bug fixes | ||
Fix an issue where info tooltips would be visible in an inappropriate position when there was no room to place them properly. | ||
## 0.19.8 (2021-11-17) | ||
@@ -2,0 +8,0 @@ |
@@ -483,5 +483,5 @@ import { Annotation, Facet, combineConfig, StateEffect, StateField, Prec, EditorSelection, Text } from '@codemirror/state'; | ||
let rect = this.dom.getBoundingClientRect(), infoRect = this.info.getBoundingClientRect(); | ||
let top = Math.min(sel.getBoundingClientRect().top, innerHeight - infoRect.height) - rect.top; | ||
if (top < 0 || top > this.list.clientHeight - 10) | ||
if (rect.top > innerHeight - 10 || rect.bottom < 10) | ||
return null; | ||
let top = Math.max(0, Math.min(sel.getBoundingClientRect().top, innerHeight - infoRect.height)) - rect.top; | ||
let left = this.view.textDirection == Direction.RTL; | ||
@@ -496,6 +496,8 @@ let spaceLeft = rect.left, spaceRight = innerWidth - rect.right; | ||
positionInfo(pos) { | ||
if (this.info && pos) { | ||
this.info.style.top = pos.top + "px"; | ||
this.info.classList.toggle("cm-completionInfo-left", pos.left); | ||
this.info.classList.toggle("cm-completionInfo-right", !pos.left); | ||
if (this.info) { | ||
this.info.style.top = (pos ? pos.top : -1e6) + "px"; | ||
if (pos) { | ||
this.info.classList.toggle("cm-completionInfo-left", pos.left); | ||
this.info.classList.toggle("cm-completionInfo-right", !pos.left); | ||
} | ||
} | ||
@@ -502,0 +504,0 @@ } |
{ | ||
"name": "@codemirror/autocomplete", | ||
"version": "0.19.8", | ||
"version": "0.19.9", | ||
"description": "Autocompletion for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138694
3210