refactor: chores in Selector.svelte
parent
cc3f618375
commit
cce9906bc8
|
@ -1,4 +1,6 @@
|
|||
<script lang="ts" context="module">
|
||||
import type { IValue } from "@upnd/upend/types";
|
||||
|
||||
export type SELECTOR_TYPE =
|
||||
| "Address"
|
||||
| "NewAddress"
|
||||
|
@ -77,7 +79,7 @@
|
|||
import { debounce } from "lodash";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import type { UpListing } from "@upnd/upend";
|
||||
import type { Address, IValue } from "@upnd/upend/types";
|
||||
import type { Address } from "@upnd/upend/types";
|
||||
import { baseSearchOnce, createLabelled } from "../../util/search";
|
||||
import UpObject from "../display/UpObject.svelte";
|
||||
import IconButton from "./IconButton.svelte";
|
||||
|
@ -342,11 +344,9 @@
|
|||
}
|
||||
|
||||
const optionEls = Array.from(listEl.children) as HTMLLIElement[];
|
||||
const currentIndex = optionEls.findIndex(
|
||||
let targetIndex = optionEls.findIndex(
|
||||
(el) => document.activeElement === el,
|
||||
);
|
||||
|
||||
let targetIndex = currentIndex;
|
||||
switch (ev.key) {
|
||||
case "ArrowDown":
|
||||
targetIndex += 1;
|
||||
|
|
Loading…
Reference in New Issue