mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 14:32:10 +01:00
Merged PR 2067: fix(ui-layout): Ipad Dropdown Scrolling Fix
fix(ui-layout): Ipad Dropdown Scrolling Fix
This commit is contained in:
committed by
Lorenz Hilpert
parent
aa57d27924
commit
d5324675ef
3
.gitignore
vendored
3
.gitignore
vendored
@@ -80,3 +80,6 @@ CLAUDE.md
|
||||
*.pyc
|
||||
.vite
|
||||
reports/
|
||||
|
||||
# Local iPad dev setup (proxy)
|
||||
/local-dev/
|
||||
|
||||
@@ -84,8 +84,11 @@ export class CloseOnScrollDirective implements OnDestroy {
|
||||
}
|
||||
this.#isActive = true;
|
||||
|
||||
// Delay listener registration to next frame to skip any stale scroll events
|
||||
this.#pendingActivation = requestAnimationFrame(() => {
|
||||
// Delay listener registration to skip scroll events caused by:
|
||||
// 1. Stale scroll events from before activation
|
||||
// 2. iOS Safari's automatic "scroll into view" when focusing elements
|
||||
// Using setTimeout with 100ms to ensure iOS scroll-into-view completes
|
||||
this.#pendingActivation = window.setTimeout(() => {
|
||||
this.#scrollListener = (event: Event) => {
|
||||
const excludeElement = this.closeOnScrollExclude();
|
||||
if (excludeElement?.contains(event.target as HTMLElement)) {
|
||||
@@ -101,12 +104,12 @@ export class CloseOnScrollDirective implements OnDestroy {
|
||||
{ capture: true, passive: true },
|
||||
);
|
||||
this.#logger.debug('Activated scroll listener');
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
#deactivate(): void {
|
||||
if (this.#pendingActivation) {
|
||||
cancelAnimationFrame(this.#pendingActivation);
|
||||
clearTimeout(this.#pendingActivation);
|
||||
this.#pendingActivation = undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user