@codemirror/autocomplete 0.19.10 → 0.19.11

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,9 @@
1
+ ## 0.19.11 (2022-01-11)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug that caused page up/down to only move the selection by two options in the completion tooltip.
6
+
1
7
  ## 0.19.10 (2022-01-05)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -783,7 +783,7 @@ function moveCompletionSelection(forward, by = "option") {
783
783
  return false;
784
784
  let step = 1, tooltip;
785
785
  if (by == "page" && (tooltip = view.dom.querySelector(".cm-tooltip-autocomplete")))
786
- step = Math.max(2, Math.floor(tooltip.offsetHeight / tooltip.firstChild.offsetHeight));
786
+ step = Math.max(2, Math.floor(tooltip.offsetHeight / tooltip.querySelector("li").offsetHeight) - 1);
787
787
  let selected = cState.open.selected + step * (forward ? 1 : -1), { length } = cState.open.options;
788
788
  if (selected < 0)
789
789
  selected = by == "page" ? 0 : length - 1;
@@ -997,7 +997,7 @@ const baseTheme = view.EditorView.baseTheme({
997
997
  }
998
998
  },
999
999
  "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
1000
- background: "#39e",
1000
+ background: "#17c",
1001
1001
  color: "white",
1002
1002
  },
1003
1003
  "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
package/dist/index.js CHANGED
@@ -779,7 +779,7 @@ function moveCompletionSelection(forward, by = "option") {
779
779
  return false;
780
780
  let step = 1, tooltip;
781
781
  if (by == "page" && (tooltip = view.dom.querySelector(".cm-tooltip-autocomplete")))
782
- step = Math.max(2, Math.floor(tooltip.offsetHeight / tooltip.firstChild.offsetHeight));
782
+ step = Math.max(2, Math.floor(tooltip.offsetHeight / tooltip.querySelector("li").offsetHeight) - 1);
783
783
  let selected = cState.open.selected + step * (forward ? 1 : -1), { length } = cState.open.options;
784
784
  if (selected < 0)
785
785
  selected = by == "page" ? 0 : length - 1;
@@ -993,7 +993,7 @@ const baseTheme = /*@__PURE__*/EditorView.baseTheme({
993
993
  }
994
994
  },
995
995
  "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
996
- background: "#39e",
996
+ background: "#17c",
997
997
  color: "white",
998
998
  },
999
999
  "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/autocomplete",
3
- "version": "0.19.10",
3
+ "version": "0.19.11",
4
4
  "description": "Autocompletion for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",