From ede03a31e4a7fdc2fe8ded331726f63ebec2088f Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 4 Jan 2023 19:12:54 +0100 Subject: [PATCH] Scroll 'delete' and 'move' into view when expanded --- UI/Popup/DeleteWizard.ts | 7 +++++++ UI/Popup/MoveWizard.ts | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/UI/Popup/DeleteWizard.ts b/UI/Popup/DeleteWizard.ts index ed999b066..ff5950aff 100644 --- a/UI/Popup/DeleteWizard.ts +++ b/UI/Popup/DeleteWizard.ts @@ -176,6 +176,13 @@ export default class DeleteWizard extends Toggle { undefined, isShown ) + + const self = this + confirm.addCallbackAndRunD((dialogIsOpened) => { + if (dialogIsOpened) { + self.ScrollIntoView() + } + }) } private static constructConfirmButton( diff --git a/UI/Popup/MoveWizard.ts b/UI/Popup/MoveWizard.ts index f1a617590..8a11d97b6 100644 --- a/UI/Popup/MoveWizard.ts +++ b/UI/Popup/MoveWizard.ts @@ -284,5 +284,13 @@ export default class MoveWizard extends Toggle { ]).SetClass("flex m-2 p-2 rounded-lg bg-gray-200"), moveDisallowedReason.map((r) => r === undefined) ) + + const self = this + currentStep.addCallback((state) => { + if (state === "start") { + return + } + self.ScrollIntoView() + }) } }