mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +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
|
*.pyc
|
||||||
.vite
|
.vite
|
||||||
reports/
|
reports/
|
||||||
|
|
||||||
|
# Local iPad dev setup (proxy)
|
||||||
|
/local-dev/
|
||||||
|
|||||||
@@ -84,8 +84,11 @@ export class CloseOnScrollDirective implements OnDestroy {
|
|||||||
}
|
}
|
||||||
this.#isActive = true;
|
this.#isActive = true;
|
||||||
|
|
||||||
// Delay listener registration to next frame to skip any stale scroll events
|
// Delay listener registration to skip scroll events caused by:
|
||||||
this.#pendingActivation = requestAnimationFrame(() => {
|
// 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) => {
|
this.#scrollListener = (event: Event) => {
|
||||||
const excludeElement = this.closeOnScrollExclude();
|
const excludeElement = this.closeOnScrollExclude();
|
||||||
if (excludeElement?.contains(event.target as HTMLElement)) {
|
if (excludeElement?.contains(event.target as HTMLElement)) {
|
||||||
@@ -101,12 +104,12 @@ export class CloseOnScrollDirective implements OnDestroy {
|
|||||||
{ capture: true, passive: true },
|
{ capture: true, passive: true },
|
||||||
);
|
);
|
||||||
this.#logger.debug('Activated scroll listener');
|
this.#logger.debug('Activated scroll listener');
|
||||||
});
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
#deactivate(): void {
|
#deactivate(): void {
|
||||||
if (this.#pendingActivation) {
|
if (this.#pendingActivation) {
|
||||||
cancelAnimationFrame(this.#pendingActivation);
|
clearTimeout(this.#pendingActivation);
|
||||||
this.#pendingActivation = undefined;
|
this.#pendingActivation = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user