Skip to content

Commit

Permalink
feat(client): disable editor when skeleton is not yet modified
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Nov 4, 2023
1 parent 758764c commit fbf66ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function ProblemSubmissionEditor({

return (
<Form onSubmit={onSubmitEditor} initialValues={initialValues}>
{({ values, handleSubmit, submitting }) => {
{({ values, handleSubmit, submitting, dirty }) => {
const submissionHint = getGradingLanguageEditorSubmissionHint(values.gradingLanguage);

return (
Expand All @@ -99,7 +99,7 @@ export function ProblemSubmissionEditor({
</p>
)}
<Field component={FormAceEditor} {...editorField} gradingLanguage={values.gradingLanguage} />
<Button type="submit" text="Submit" intent={Intent.PRIMARY} loading={submitting} />
<Button type="submit" text="Submit" intent={Intent.PRIMARY} loading={submitting} disabled={!dirty} />
</form>
);
}}
Expand Down

0 comments on commit fbf66ba

Please sign in to comment.