Skip to content

FOUR-17551:Scrollbar Position Issue When Navigating to Next Page #7951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion resources/js/processes/screen-builder/screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
id="preview"
class="h-100 m-0"
>
<b-col class="d-flex overflow-auto h-100">
<b-col
ref="preview-screen"
class="d-flex overflow-auto h-100"
>
<vue-form-renderer
v-if="renderComponent === 'task-screen'"
ref="renderer"
Expand All @@ -56,6 +59,7 @@
:show-errors="true"
:mock-magic-variables="mockMagicVariables"
:device-screen="deviceScreen"
@update-page-task="updatePage"
@submit="previewSubmit"
@update="onUpdate"
@css-errors="cssErrors = $event"
Expand All @@ -77,6 +81,7 @@
:watchers="preview.watchers"
:data="previewData"
:type="screen.type"
@update-page-task="updatePage"
@update="onUpdate"
@submit="previewSubmit"
/>
Expand Down Expand Up @@ -1237,6 +1242,11 @@ export default {
4,
);
},
updatePage() {
if (this.$refs["preview-screen"]) {
this.$refs["preview-screen"].scrollTop = 0;
}
},
},
};
</script>
Expand Down
3 changes: 3 additions & 0 deletions resources/js/tasks/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ const main = new Vue({
taskUpdated(task) {
this.task = task;
},
updatePage() {
document.getElementById("tabContent").scrollTop = 0;
},
updateScreenFields(taskId) {
return ProcessMaker.apiClient
.get(`tasks/${taskId}/screen_fields`)
Expand Down
3 changes: 2 additions & 1 deletion resources/views/tasks/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function() use ($task) {
<div
class="tw-flex tw-w-full tw-grow px-3">
<div class="tw-flex tw-w-full tw-grow">
<div class="tw-flex tw-flex-col tw-grow">
<div class="tw-flex tw-flex-col tw-grow tw-overflow-hidden container-height">
<div
v-if="isSelfService"
class="alert alert-primary"
Expand Down Expand Up @@ -99,6 +99,7 @@ class="card border-0"
initial-loop-context="{{ $task->getLoopContext() }}"
:wait-loading-listeners="true"
@task-updated="taskUpdated"
@updated-page-core="updatePage"
@submit="submit"
@completed="completed"
@@error="error"
Expand Down