Fix scroll-to-factcheck: use scroll event lock during rendering
The double-rAF callbacks from resizeTileToContent fire after the initial scrollTop=0 reset. Add a scroll event listener that forces scrollTop=0 during the entire rendering phase, then remove it after 3 animation frames (covering all double-rAF resize callbacks). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -636,15 +636,18 @@ const App = {
|
|||||||
if (inc) this._announceForSR('Lage ausgewählt: ' + inc.title);
|
if (inc) this._announceForSR('Lage ausgewählt: ' + inc.title);
|
||||||
this.renderSidebar();
|
this.renderSidebar();
|
||||||
|
|
||||||
var mc = document.getElementById("main-content");
|
var mc = document.getElementById(main-content);
|
||||||
mc.scrollTop = 0;
|
mc.scrollTop = 0;
|
||||||
|
|
||||||
document.getElementById('empty-state').style.display = 'none';
|
document.getElementById('empty-state').style.display = 'none';
|
||||||
document.getElementById('incident-view').style.display = 'flex';
|
document.getElementById('incident-view').style.display = 'flex';
|
||||||
|
|
||||||
// GridStack-Animation temporaer deaktivieren um Scroll-Sprung zu verhindern
|
// GridStack-Animation deaktivieren und Scroll komplett sperren
|
||||||
|
// bis alle Tile-Resize-Operationen (doppeltes rAF) abgeschlossen sind
|
||||||
var gridEl = document.querySelector('.grid-stack');
|
var gridEl = document.querySelector('.grid-stack');
|
||||||
if (gridEl) gridEl.classList.remove('grid-stack-animate');
|
if (gridEl) gridEl.classList.remove('grid-stack-animate');
|
||||||
|
var scrollLock = function() { mc.scrollTop = 0; };
|
||||||
|
mc.addEventListener('scroll', scrollLock);
|
||||||
|
|
||||||
// gridstack-Layout initialisieren (einmalig)
|
// gridstack-Layout initialisieren (einmalig)
|
||||||
if (typeof LayoutManager !== 'undefined') LayoutManager.init();
|
if (typeof LayoutManager !== 'undefined') LayoutManager.init();
|
||||||
@@ -660,11 +663,16 @@ const App = {
|
|||||||
|
|
||||||
await this.loadIncidentDetail(id);
|
await this.loadIncidentDetail(id);
|
||||||
|
|
||||||
// Zum Header scrollen und Animation wieder aktivieren
|
// Scroll-Sperre nach 3 Frames aufheben (nach allen doppelten rAF-Callbacks)
|
||||||
mc.scrollTop = 0;
|
mc.scrollTop = 0;
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
mc.scrollTop = 0;
|
requestAnimationFrame(() => {
|
||||||
if (gridEl) gridEl.classList.add('grid-stack-animate');
|
requestAnimationFrame(() => {
|
||||||
|
mc.scrollTop = 0;
|
||||||
|
mc.removeEventListener('scroll', scrollLock);
|
||||||
|
if (gridEl) gridEl.classList.add('grid-stack-animate');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren