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:
@@ -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 ── */
|
||||
|
||||
Reference in New Issue
Block a user