Fix scroll position reset when closing modals

- Use { behavior: 'instant' } in unlockBody scrollTo to override
  CSS scroll-behavior: smooth on html element
- Use { preventScroll: true } on focus() restore in Modal.forceClose
- Add overflow-y: scroll to body.modal-open to prevent scrollbar shift

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-18 11:39:53 +03:00
parent ea9b05733b
commit 6a31814900
3 changed files with 3 additions and 2 deletions

View File

@@ -93,6 +93,7 @@ body {
body.modal-open {
position: fixed;
width: 100%;
overflow-y: scroll; /* keep scrollbar gutter to prevent layout shift */
}
/* ── Ambient animated background ── */