Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-form): check field states and refresh form when …
Browse files Browse the repository at this point in the history
…cleared (#1301)

Co-authored-by: David Featherston <david.featherstone@dpc.vic.gov.au>
  • Loading branch information
lambry and David Featherston committed May 26, 2023
1 parent 56dd085 commit 8ffa5bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/Molecules/Form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export default {
}
this.$nextTick(() => {
this.isClearingForm = false
this.$refs.vfg.$forceUpdate()
})
},
async onSubmit (event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script>
import RplForm from '@dpc-sdp/ripple-form'
import RplForm, { RplFormEventBus } from '@dpc-sdp/ripple-form'
import webform from '@dpc-sdp/ripple-nuxt-tide/modules/webform/mixins'
import conditionalLogic from '@dpc-sdp/ripple-nuxt-tide/modules/webform/conditional-logic'
Expand Down Expand Up @@ -151,6 +151,11 @@ export default {
field.onChanged = this.checkFieldStates
})
}
RplFormEventBus.$on('clearform', this.checkFieldStates)
},
destroyed () {
RplFormEventBus.$off('clearform', this.checkFieldStates)
}
}
</script>

0 comments on commit 8ffa5bd

Please sign in to comment.