Repository navigation
fix(Backdrop, Modal, Offcanvas): scroll lock and modal-open per owner, backdrop after its own fade, hide ends with the transitions - #327
Merged
Conversation
…, backdrop after its own fade, hide ends with the transitions - BackdropService: lockScroll(owner)/unlockScroll(owner); hideScrollbar()/resetScrollbar() deprecated, lock on behalf of the service; clearBackdrop() no longer touches the lock; scrollbarWidth measured at the first lock; unlock removes only the padding side it set. - Backdrop: one element per type, removed after its own fade, revived while fading, no 0.5 → 0 → 0.5 flash; setBackdrop(type, fade); no flash when released or revived before its delayed show. - Modal: lock and modal-open (ModalService.addOpenClass/removeOpenClass) held until the host and dialog transitions end, released at once on destroy; reduced motion and transition=false hide at once; a close during a server render leaves a clean body; a never-opened modal keeps its display. - Offcanvas: lock follows visible and scroll, not the backdrop; rtl padding removed without a backdrop; content inert at close, the host takes clicks until the hide ends and focus only while its content is active. - shared/transition.utils: afterTransitions(element), the running CSS transitions, no timers. - OffcanvasModule, ModalModule: no services in providers, root instances. - Offcanvas specs run in a test host.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body scroll lock and modal-open are held per owner and released when the hide transitions end, not when the backdrop goes. The backdrop is one element per type, removed after its own fade and brought back while fading, so switching modals no longer flashes 0.5 → 0 → 0.5. No timers: the end comes from the element's running CSS transitions (getAnimations), or a microtask when nothing transitions (reduced motion, transition=false, jsdom, server).
Behaviour changes:
Offcanvas specs run the component in a test host, no hosts or backdrops left in the shared document.