Skip to content

Commit 5b838d0

Browse files
committed
Keep the Query button width while in the isLoading state
1 parent b4e08bd commit 5b838d0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

apps/webapp/app/components/query/QueryEditor.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,22 @@ const QueryEditorForm = forwardRef<
354354
variant="primary/small"
355355
disabled={isLoading || !query.trim()}
356356
shortcut={{ modifiers: ["mod"], key: "enter", enabledOnInputElements: true }}
357-
LeadingIcon={isLoading ? <Spinner className="size-4" color="white" /> : undefined}
357+
className={
358+
isLoading
359+
? "relative !text-transparent [&_*]:!border-transparent [&_*]:!text-transparent"
360+
: undefined
361+
}
358362
>
359-
{isLoading ? "Querying..." : "Query"}
363+
{isLoading ? (
364+
<>
365+
Query
366+
<span className="pointer-events-none absolute inset-0 flex items-center justify-center">
367+
<Spinner className="size-4 opacity-50" color="white" />
368+
</span>
369+
</>
370+
) : (
371+
"Query"
372+
)}
360373
</Button>
361374
</div>
362375
</fetcher.Form>

0 commit comments

Comments
 (0)