@codemirror/autocomplete
Advanced tools
Comparing version 0.19.11 to 0.19.12
@@ -0,1 +1,7 @@ | ||
## 0.19.12 (2022-01-11) | ||
### Bug fixes | ||
Fix completion navigation with PageUp/Down when the completion tooltip isn't part of the view DOM. | ||
## 0.19.11 (2022-01-11) | ||
@@ -2,0 +8,0 @@ |
import { Annotation, Facet, combineConfig, StateEffect, StateField, Prec, EditorSelection, Text } from '@codemirror/state'; | ||
import { Direction, logException, EditorView, ViewPlugin, Decoration, WidgetType, keymap } from '@codemirror/view'; | ||
import { showTooltip } from '@codemirror/tooltip'; | ||
import { showTooltip, getTooltip } from '@codemirror/tooltip'; | ||
import { syntaxTree, indentUnit } from '@codemirror/language'; | ||
@@ -781,4 +781,5 @@ import { codePointAt, codePointSize, fromCodePoint } from '@codemirror/text'; | ||
let step = 1, tooltip; | ||
if (by == "page" && (tooltip = view.dom.querySelector(".cm-tooltip-autocomplete"))) | ||
step = Math.max(2, Math.floor(tooltip.offsetHeight / tooltip.querySelector("li").offsetHeight) - 1); | ||
if (by == "page" && (tooltip = getTooltip(view, cState.open.tooltip))) | ||
step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / | ||
tooltip.dom.querySelector("li").offsetHeight) - 1); | ||
let selected = cState.open.selected + step * (forward ? 1 : -1), { length } = cState.open.options; | ||
@@ -785,0 +786,0 @@ if (selected < 0) |
{ | ||
"name": "@codemirror/autocomplete", | ||
"version": "0.19.11", | ||
"version": "0.19.12", | ||
"description": "Autocompletion for the CodeMirror code editor", | ||
@@ -32,3 +32,3 @@ "scripts": { | ||
"@codemirror/text": "^0.19.2", | ||
"@codemirror/tooltip": "^0.19.0", | ||
"@codemirror/tooltip": "^0.19.12", | ||
"@codemirror/view": "^0.19.0", | ||
@@ -35,0 +35,0 @@ "@lezer/common": "^0.15.0" |
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
140170
3224
Updated@codemirror/tooltip@^0.19.12