Merge pull request #2495 from TheMas3212/fix-2163

Clear input field for CodingContractModal after submission
This commit is contained in:
hydroflame 2022-01-09 13:01:34 -05:00 committed by GitHub
commit f6bc3b0b5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,6 +40,7 @@ export function CodingContractModal(): React.ReactElement {
if (event.keyCode === KEY.ENTER && value !== "") { if (event.keyCode === KEY.ENTER && value !== "") {
event.preventDefault(); event.preventDefault();
props.onAttempt(answer); props.onAttempt(answer);
setAnswer("");
close(); close();
} }
} }
@ -75,6 +76,7 @@ export function CodingContractModal(): React.ReactElement {
<Button <Button
onClick={() => { onClick={() => {
props.onAttempt(answer); props.onAttempt(answer);
setAnswer("");
close(); close();
}} }}
> >