Skip to content

Commit

Permalink
Merge pull request #33 from a16z-infra/disable-input-on-submit
Browse files Browse the repository at this point in the history
disable input box when submitting
  • Loading branch information
ykhli authored Jul 5, 2023
2 parents 9fc4ab7 + 52bc126 commit d8153f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/QAModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export default function QAModal({
<form onSubmit={handleSubmit}>
<input
placeholder="How's your day?"
className="w-full flex-auto rounded-md border-0 bg-white/5 px-3.5 py-2 text-white shadow-sm focus:outline-none sm:text-sm sm:leading-6"
className={"w-full flex-auto rounded-md border-0 bg-white/5 px-3.5 py-2 shadow-sm focus:outline-none sm:text-sm sm:leading-6 " + (isLoading && !completion ? "text-gray-600 cursor-not-allowed" : "text-white")}
value={input}
onChange={handleInputChange}
disabled={isLoading && !completion}
/>
</form>
<div className="mt-3 sm:mt-5">
Expand Down

0 comments on commit d8153f5

Please sign in to comment.