Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Fix: model and dataset dropdowns selecting stale value on Enter

imagineer99759ae059dba9
diff --git a/studio/frontend/src/features/studio/sections/dataset-section.tsx b/studio/frontend/src/features/studio/sections/dataset-section.tsx
index e3f50efb40f..97bd1304f02 100644
--- a/studio/frontend/src/features/studio/sections/dataset-section.tsx
+++ b/studio/frontend/src/features/studio/sections/dataset-section.tsx
@@ -109,7 +109,7 @@ export function DatasetSection() {
const resultIds = useMemo(() => {
const ids = hfResults.map((r) => r.id);
if (dataset && !ids.includes(dataset)) {
- ids.unshift(dataset);
+ ids.push(dataset);
}
return ids;
}, [hfResults, dataset]);
@@ -159,7 +159,20 @@ export function DatasetSection() {
</TooltipContent>
</Tooltip>
</span>
- <div ref={comboboxAnchorRef}>
+ <div
+ ref={comboboxAnchorRef}
+ onKeyDown={(event) => {
+ if (event.key !== "Enter") return;
+ if (!(event.target instanceof HTMLInputElement)) return;
+ event.preventDefault();
+ if (hfResults.length > 0) {
+ handleDatasetSelect(hfResults[0].id);
+ } else {
+ const text = event.target.value.trim();
+ if (text) handleDatasetSelect(text);
+ }
+ }}
+ >
<Combobox
items={resultIds}
filteredItems={resultIds}
@@ -170,10 +183,7 @@ export function DatasetSection() {
itemToStringValue={(id) => id}
autoHighlight={true}
>
- <ComboboxInput
- placeholder="Search datasets..."
- className="w-full"
- >
+ <ComboboxInput placeholder="Search datasets..." className="w-full">
<InputGroupAddon>
<HugeiconsIcon icon={Search01Icon} className="size-4" />
</InputGroupAddon>
diff --git a/studio/frontend/src/features/studio/sections/model-section.tsx b/studio/frontend/src/features/studio/sections/model-section.tsx
index 32810e07004..501a4a41e36 100644
--- a/studio/frontend/src/features/studio/sections/model-section.tsx
+++ b/studio/frontend/src/features/studio/sections/model-section.tsx
@@ -160,7 +160,7 @@ export function ModelSection() {
const resultIds = useMemo(() => {
const ids = hfResults.map((r) => r.id);
if (selectedModel && !ids.includes(selectedModel)) {
- ids.unshift(selectedModel);
+ ids.push(selectedModel);
}
return ids;
}, [hfResults, selectedModel]);
@@ -375,7 +375,20 @@ export function ModelSection() {
</TooltipContent>
</Tooltip>
</span>
- <div ref={comboboxAnchorRef}>
+ <div
+ ref={comboboxAnchorRef}
+ onKeyDown={(event) => {
+ if (event.key !== "Enter") return;
+ if (!(event.target instanceof HTMLInputElement)) return;
+ event.preventDefault();
+ if (hfResults.length > 0) {
+ handleModelSelect(hfResults[0].id);
+ } else {
+ const text = event.target.value.trim();
+ if (text) handleModelSelect(text);
+ }
+ }}
+ >
<Combobox
items={resultIds}
filteredItems={resultIds}