Skip to content

Commit

Permalink
Scroll to component on error
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Jan 21, 2025
1 parent f5ff1c2 commit cfd10e4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
Please save your payment settings before making any product changes
</span>
<AccountPaymentMethods
ref="paymentMethodRef"
:isEditing="isEditing"
:isBcolAdmin="isBcolAdmin"
@disable-editing="isEditing = false"
Expand Down Expand Up @@ -219,6 +220,8 @@ export default defineComponent({
currentSelectedProducts
} = storeToRefs(useOrgStore())
const paymentMethodRef = ref(null)
const state = reactive({
isBtnSaved: false,
disableSaveBtn: false,
Expand Down Expand Up @@ -480,6 +483,12 @@ export default defineComponent({
}
})
watch(() => state.displaySavePaymentMethodsFirst, (newValue) => {
if (newValue) {
paymentMethodRef.value.$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
}
})
return {
setup,
closeError,
Expand All @@ -497,6 +506,7 @@ export default defineComponent({
AccountStatus,
ProductStatus,
ProductEnum,
paymentMethodRef,
...toRefs(state)
}
}
Expand Down

0 comments on commit cfd10e4

Please sign in to comment.