Skip to content

Commit c366a6e

Browse files
committed
Revert "Update API options on blur instead of on input"
This reverts commit 6a8902f.
1 parent 7eada8b commit c366a6e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
178178
value={apiConfiguration?.apiKey || ""}
179179
style={{ width: "100%" }}
180180
type="password"
181-
onBlur={handleInputChange("apiKey")}
181+
onInput={handleInputChange("apiKey")}
182182
placeholder="Enter API Key...">
183183
<span style={{ fontWeight: 500 }}>Anthropic API Key</span>
184184
</VSCodeTextField>
@@ -203,7 +203,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
203203
value={apiConfiguration?.anthropicBaseUrl || ""}
204204
style={{ width: "100%", marginTop: 3 }}
205205
type="url"
206-
onBlur={handleInputChange("anthropicBaseUrl")}
206+
onInput={handleInputChange("anthropicBaseUrl")}
207207
placeholder="Default: https://api.anthropic.com"
208208
/>
209209
)}
@@ -232,7 +232,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
232232
value={apiConfiguration?.glamaApiKey || ""}
233233
style={{ width: "100%" }}
234234
type="password"
235-
onBlur={handleInputChange("glamaApiKey")}
235+
onInput={handleInputChange("glamaApiKey")}
236236
placeholder="Enter API Key...">
237237
<span style={{ fontWeight: 500 }}>Glama API Key</span>
238238
</VSCodeTextField>
@@ -282,7 +282,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
282282
value={apiConfiguration?.openAiNativeApiKey || ""}
283283
style={{ width: "100%" }}
284284
type="password"
285-
onBlur={handleInputChange("openAiNativeApiKey")}
285+
onInput={handleInputChange("openAiNativeApiKey")}
286286
placeholder="Enter API Key...">
287287
<span style={{ fontWeight: 500 }}>OpenAI API Key</span>
288288
</VSCodeTextField>
@@ -310,7 +310,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
310310
value={apiConfiguration?.mistralApiKey || ""}
311311
style={{ width: "100%" }}
312312
type="password"
313-
onBlur={handleInputChange("mistralApiKey")}
313+
onInput={handleInputChange("mistralApiKey")}
314314
placeholder="Enter API Key...">
315315
<span style={{ fontWeight: 500 }}>Mistral API Key</span>
316316
</VSCodeTextField>
@@ -364,7 +364,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
364364
value={apiConfiguration?.openRouterApiKey || ""}
365365
style={{ width: "100%" }}
366366
type="password"
367-
onBlur={handleInputChange("openRouterApiKey")}
367+
onInput={handleInputChange("openRouterApiKey")}
368368
placeholder="Enter API Key...">
369369
<span style={{ fontWeight: 500 }}>OpenRouter API Key</span>
370370
</VSCodeTextField>
@@ -446,7 +446,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
446446
<VSCodeTextField
447447
value={apiConfiguration?.awsProfile || ""}
448448
style={{ width: "100%" }}
449-
onBlur={handleInputChange("awsProfile")}
449+
onInput={handleInputChange("awsProfile")}
450450
placeholder="Enter profile name">
451451
<span style={{ fontWeight: 500 }}>AWS Profile Name</span>
452452
</VSCodeTextField>
@@ -457,23 +457,23 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
457457
value={apiConfiguration?.awsAccessKey || ""}
458458
style={{ width: "100%" }}
459459
type="password"
460-
onBlur={handleInputChange("awsAccessKey")}
460+
onInput={handleInputChange("awsAccessKey")}
461461
placeholder="Enter Access Key...">
462462
<span style={{ fontWeight: 500 }}>AWS Access Key</span>
463463
</VSCodeTextField>
464464
<VSCodeTextField
465465
value={apiConfiguration?.awsSecretKey || ""}
466466
style={{ width: "100%" }}
467467
type="password"
468-
onBlur={handleInputChange("awsSecretKey")}
468+
onInput={handleInputChange("awsSecretKey")}
469469
placeholder="Enter Secret Key...">
470470
<span style={{ fontWeight: 500 }}>AWS Secret Key</span>
471471
</VSCodeTextField>
472472
<VSCodeTextField
473473
value={apiConfiguration?.awsSessionToken || ""}
474474
style={{ width: "100%" }}
475475
type="password"
476-
onBlur={handleInputChange("awsSessionToken")}
476+
onInput={handleInputChange("awsSessionToken")}
477477
placeholder="Enter Session Token...">
478478
<span style={{ fontWeight: 500 }}>AWS Session Token</span>
479479
</VSCodeTextField>
@@ -541,7 +541,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
541541
<VSCodeTextField
542542
value={apiConfiguration?.vertexProjectId || ""}
543543
style={{ width: "100%" }}
544-
onBlur={handleInputChange("vertexProjectId")}
544+
onInput={handleInputChange("vertexProjectId")}
545545
placeholder="Enter Project ID...">
546546
<span style={{ fontWeight: 500 }}>Google Cloud Project ID</span>
547547
</VSCodeTextField>
@@ -599,7 +599,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
599599
value={apiConfiguration?.geminiApiKey || ""}
600600
style={{ width: "100%" }}
601601
type="password"
602-
onBlur={handleInputChange("geminiApiKey")}
602+
onInput={handleInputChange("geminiApiKey")}
603603
placeholder="Enter API Key...">
604604
<span style={{ fontWeight: 500 }}>Gemini API Key</span>
605605
</VSCodeTextField>
@@ -627,15 +627,15 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
627627
value={apiConfiguration?.openAiBaseUrl || ""}
628628
style={{ width: "100%" }}
629629
type="url"
630-
onBlur={handleInputChange("openAiBaseUrl")}
630+
onInput={handleInputChange("openAiBaseUrl")}
631631
placeholder={"Enter base URL..."}>
632632
<span style={{ fontWeight: 500 }}>Base URL</span>
633633
</VSCodeTextField>
634634
<VSCodeTextField
635635
value={apiConfiguration?.openAiApiKey || ""}
636636
style={{ width: "100%" }}
637637
type="password"
638-
onBlur={handleInputChange("openAiApiKey")}
638+
onInput={handleInputChange("openAiApiKey")}
639639
placeholder="Enter API Key...">
640640
<span style={{ fontWeight: 500 }}>API Key</span>
641641
</VSCodeTextField>
@@ -678,7 +678,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
678678
<VSCodeTextField
679679
value={apiConfiguration?.azureApiVersion || ""}
680680
style={{ width: "100%", marginTop: 3 }}
681-
onBlur={handleInputChange("azureApiVersion")}
681+
onInput={handleInputChange("azureApiVersion")}
682682
placeholder={`Default: ${azureOpenAiDefaultApiVersion}`}
683683
/>
684684
)}
@@ -1128,14 +1128,14 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
11281128
value={apiConfiguration?.lmStudioBaseUrl || ""}
11291129
style={{ width: "100%" }}
11301130
type="url"
1131-
onBlur={handleInputChange("lmStudioBaseUrl")}
1131+
onInput={handleInputChange("lmStudioBaseUrl")}
11321132
placeholder={"Default: http://localhost:1234"}>
11331133
<span style={{ fontWeight: 500 }}>Base URL (optional)</span>
11341134
</VSCodeTextField>
11351135
<VSCodeTextField
11361136
value={apiConfiguration?.lmStudioModelId || ""}
11371137
style={{ width: "100%" }}
1138-
onBlur={handleInputChange("lmStudioModelId")}
1138+
onInput={handleInputChange("lmStudioModelId")}
11391139
placeholder={"e.g. meta-llama-3.1-8b-instruct"}>
11401140
<span style={{ fontWeight: 500 }}>Model ID</span>
11411141
</VSCodeTextField>
@@ -1197,7 +1197,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
11971197
value={apiConfiguration?.deepSeekApiKey || ""}
11981198
style={{ width: "100%" }}
11991199
type="password"
1200-
onBlur={handleInputChange("deepSeekApiKey")}
1200+
onInput={handleInputChange("deepSeekApiKey")}
12011201
placeholder="Enter API Key...">
12021202
<span style={{ fontWeight: 500 }}>DeepSeek API Key</span>
12031203
</VSCodeTextField>
@@ -1287,14 +1287,14 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
12871287
value={apiConfiguration?.ollamaBaseUrl || ""}
12881288
style={{ width: "100%" }}
12891289
type="url"
1290-
onBlur={handleInputChange("ollamaBaseUrl")}
1290+
onInput={handleInputChange("ollamaBaseUrl")}
12911291
placeholder={"Default: http://localhost:11434"}>
12921292
<span style={{ fontWeight: 500 }}>Base URL (optional)</span>
12931293
</VSCodeTextField>
12941294
<VSCodeTextField
12951295
value={apiConfiguration?.ollamaModelId || ""}
12961296
style={{ width: "100%" }}
1297-
onBlur={handleInputChange("ollamaModelId")}
1297+
onInput={handleInputChange("ollamaModelId")}
12981298
placeholder={"e.g. llama3.1"}>
12991299
<span style={{ fontWeight: 500 }}>Model ID</span>
13001300
</VSCodeTextField>

0 commit comments

Comments
 (0)