Skip to content

Commit c476a22

Browse files
committed
Remove the pristine field
1 parent 64e6363 commit c476a22

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src-ts/lib/form/form-functions/form.functions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export async function onSubmitAsync<T>(
7979

8080
// get the dirty fields before we validate b/c validation marks them dirty on submit
8181
const dirty: FormInputModel | undefined = inputs?.find(fieldDef => !!fieldDef.dirty)
82-
const pristine: FormInputModel | undefined = inputs?.find(fieldDef => !!fieldDef.pristine)
8382
// if there are any validation errors, display a message and stop submitting
8483
// NOTE: need to check this before we check if the form is dirty bc you
8584
// could have a form that's not dirty but has errors and you wouldn't
@@ -99,7 +98,7 @@ export async function onSubmitAsync<T>(
9998
})
10099

101100
// if there are no dirty fields, don't actually perform the save
102-
const savePromise: Promise<void> = !dirty && !pristine ? Promise.resolve() : save(formValue)
101+
const savePromise: Promise<void> = !dirty ? Promise.resolve() : save(formValue)
103102

104103
return savePromise
105104
.then(() => {

src-ts/lib/form/form-input.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export interface FormInputModel {
4343
readonly notTabbable?: boolean
4444
options?: ReadonlyArray<FormRadioButtonOption>
4545
readonly placeholder?: string
46-
pristine?: boolean
4746
readonly spellCheck?: boolean
4847
readonly title?: string
4948
touched?: boolean

src-ts/tools/work/work-self-service/intake-forms/bug-hunt/bug-hunt.form.config.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const BugHuntFormConfig: FormDefinition = {
4343
label: 'Project title',
4444
name: ChallengeMetadataName.projectTitle,
4545
placeholder: 'Enter a descriptive title',
46-
pristine: true,
4746
type: 'text',
4847
validators: [
4948
{

0 commit comments

Comments
 (0)