Skip to content

Commit

Permalink
fix: prevent default on submit
Browse files Browse the repository at this point in the history
  • Loading branch information
MaGOs92 committed May 26, 2023
1 parent 96d1965 commit a0702be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/settings/user-settings-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function UserSettings() {

const hasChanged = () => JSON.stringify(userSettingsForm) !== JSON.stringify(userSettings)

const onSubmit = () => {
const onSubmit = e => {
e.preventDefault()
setUserSettings(userSettingsForm)
}

Expand Down Expand Up @@ -48,7 +49,7 @@ function UserSettings() {
<Checkbox
name='colourblind-mode'
id='colourblind-mode'
label='Mode daltonien'
label='Activer le mode daltonien'
checked={userSettingsForm?.colourblindMode}
onChange={() => setUserSettingsForm(settings => ({...settings, colourblindMode: !settings?.colourblindMode}))}
/>
Expand Down

0 comments on commit a0702be

Please sign in to comment.