Skip to content

Commit

Permalink
Scroll to first invalid field on error
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKostka committed Jan 19, 2024
1 parent bf6cf41 commit c9c8149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Pages/ManageWiki/Cards/QuestyCaptcha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ export default {
}
await this.$nextTick()
if (!this.$refs.questyForm.validate()) {
const invalidField = this.$refs.questyForm.$children.find((field) => {
return typeof field.validate === 'function' && !field.validate()
})
if (invalidField) {
invalidField.$el.scrollIntoView({ behavior: 'smooth' })
return
}
Expand Down

0 comments on commit c9c8149

Please sign in to comment.