]> git.ipfire.org Git - thirdparty/bootstrap.git/commit
Dialog/Drawer: fix focus-restore scroll and dispose-while-open cleanup (#42544)
authorMark Otto <markd.otto@gmail.com>
Sat, 27 Jun 2026 03:14:40 +0000 (20:14 -0700)
committerGitHub <noreply@github.com>
Sat, 27 Jun 2026 03:14:40 +0000 (20:14 -0700)
commitaa273699314cabde5b57f784dfa54c2f11c2610d
tree2926a0705425f874c79c73444f7ed096775436fe
parentc654bab5b5af38f8477e98fdfa058d180f1d3ce9
Dialog/Drawer: fix focus-restore scroll and dispose-while-open cleanup (#42544)

* Dialog/Drawer: don't scroll the page when restoring focus on close

Pass { preventScroll: true } when returning focus to the trigger after
close, so the page no longer jumps to the trigger (or to the top when
scroll-padding-top is set). Fixes #38070, #41615, #35391.

* Dialog/Drawer: restore body scroll when disposed while open

dispose() now closes the native <dialog> and removes the dialog-open
body class if the instance is torn down while still open (e.g. an SPA
route change), instead of leaving overflow: hidden stuck on the body.
Fixes #35934, #39910.

* Bump bundlewatch size thresholds
.bundlewatch.config.json
js/src/dialog-base.js
js/src/dialog.js
js/src/drawer.js
js/tests/unit/dialog.spec.js
js/tests/unit/drawer.spec.js