mishig HF staff commited on
Commit
90c9ef4
1 Parent(s): 65131f6

select model on enter

Browse files
src/lib/components/InferencePlayground/InferencePlaygroundModelSelectorModal.svelte CHANGED
@@ -24,8 +24,10 @@
24
  event.preventDefault();
25
  dispatch("close");
26
  } else if (key === "Enter") {
27
- const searchEls = (containerEl.firstChild?.childNodes ?? []) as HTMLAnchorElement[];
28
- searchEls?.[highlightIdx].click();
 
 
29
  } else if (key === "ArrowUp") {
30
  event.preventDefault();
31
  highlightIdx--;
 
24
  event.preventDefault();
25
  dispatch("close");
26
  } else if (key === "Enter") {
27
+ const highlightedEl = document.querySelector(".highlighted");
28
+ if (highlightedEl) {
29
+ (highlightedEl as HTMLButtonElement).click();
30
+ }
31
  } else if (key === "ArrowUp") {
32
  event.preventDefault();
33
  highlightIdx--;