Skip to content

Commit

Permalink
feat(ZMS-2936): fix scroll bug for all views
Browse files Browse the repository at this point in the history
  • Loading branch information
lehju committed Feb 25, 2025
1 parent 9529aa5 commit 97b0a59
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions zmscitizenview/src/components/Appointment/AppointmentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
/>
</div>
<div v-if="currentView === 3">
<!-- Delete tooManyAppointmentsWithSameMailError if contact is transferred from backend call offices-and-services -->
<appointment-summary
v-if="
!updateAppointmentError &&
Expand Down Expand Up @@ -174,7 +173,7 @@

<script setup lang="ts">
import { MucCallout, MucStepper } from "@muenchen/muc-patternlab-vue";
import { onMounted, provide, ref, watch } from "vue";
import { nextTick, onMounted, provide, ref, watch } from "vue";
import { AppointmentDTO } from "@/api/models/AppointmentDTO";
import { ErrorDTO } from "@/api/models/ErrorDTO";
Expand Down Expand Up @@ -472,8 +471,17 @@ const nextCancelReschedule = () => {
*/
watch(currentView, (newCurrentView) => {
activeStep.value = newCurrentView.toString();
goToTop();
});
/**
* Sets the view to the top of the page after change the current view
*/
const goToTop = async () => {
await nextTick();
window.scrollTo({ top: 0, behavior: "instant" });
};
const getProviders = (serviceId: string, providers: string[] | null) => {
const officesAtService = new Array<OfficeImpl>();
relations.value.forEach((relation) => {
Expand Down

0 comments on commit 97b0a59

Please sign in to comment.