Clear input field for CodingContractModal after submission

This commit is contained in:
TheMas3212 2022-01-09 15:26:36 +11:00
parent 0de588ee17
commit 5901312184
No known key found for this signature in database
GPG Key ID: 62A173A4FDA683CA

@ -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();
}} }}
> >