Skip to content

Commit

Permalink
fix identy selection & headers (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosch authored Jan 28, 2025
1 parent 14ee661 commit fc93837
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
32 changes: 19 additions & 13 deletions packages/zudoku/src/lib/plugins/openapi/playground/Headers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,25 @@ export const Headers = ({
/>
</div>
<div className="flex items-center gap-2">
<Input
placeholder="Value"
className="w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0"
{...register(`headers.${i}.value`)}
ref={(el) => {
valueRefs.current[i] = el;
}}
onKeyDown={(e) => {
if (e.key === "Enter" && e.currentTarget.value.trim()) {
handleValueEnter(i);
}
}}
autoComplete="off"
<Controller
control={control}
name={`headers.${i}.value`}
render={({ field }) => (
<Input
placeholder="Value"
className="w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0"
{...field}
ref={(el) => {
valueRefs.current[i] = el;
}}
onKeyDown={(e) => {
if (e.key === "Enter" && e.currentTarget.value.trim()) {
handleValueEnter(i);
}
}}
autoComplete="off"
/>
)}
/>
<Button
size="icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ const SubmitButton = ({
<Button
className="rounded-r-none inset-shadow-sm"
disabled={disabled}
onClick={() => {
setValue("identity", dropdownValue);
formRef?.current?.requestSubmit();
}}
onClick={() => formRef?.current?.requestSubmit()}
>
Send
</Button>
Expand Down

0 comments on commit fc93837

Please sign in to comment.