Fix scroll-to-factcheck: disable GridStack animation during incident switch
Remove grid-stack-animate class before rendering to prevent CSS transitions from causing browser scroll-follow to repositioned tiles. Re-enable animation after content is loaded and scroll is reset. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -632,22 +632,24 @@ const App = {
|
|||||||
this.closeRefreshHistory();
|
this.closeRefreshHistory();
|
||||||
this.currentIncidentId = id;
|
this.currentIncidentId = id;
|
||||||
localStorage.setItem('selectedIncidentId', id);
|
localStorage.setItem('selectedIncidentId', id);
|
||||||
// SR-Announcement
|
|
||||||
// Scroll komplett blockieren bevor irgendetwas gerendert wird
|
|
||||||
var mc = document.getElementById("main-content");
|
|
||||||
mc.style.overflow = "hidden";
|
|
||||||
mc.scrollTop = 0;
|
|
||||||
const inc = this.incidents.find(i => i.id === id);
|
const inc = this.incidents.find(i => i.id === id);
|
||||||
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");
|
||||||
|
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
|
||||||
|
var gridEl = document.querySelector('.grid-stack');
|
||||||
|
if (gridEl) gridEl.classList.remove('grid-stack-animate');
|
||||||
|
|
||||||
// gridstack-Layout initialisieren (einmalig)
|
// gridstack-Layout initialisieren (einmalig)
|
||||||
if (typeof LayoutManager !== 'undefined') LayoutManager.init();
|
if (typeof LayoutManager !== 'undefined') LayoutManager.init();
|
||||||
|
|
||||||
// Refresh-Status für diese Lage wiederherstellen
|
// Refresh-Status fuer diese Lage wiederherstellen
|
||||||
const isRefreshing = this._refreshingIncidents.has(id);
|
const isRefreshing = this._refreshingIncidents.has(id);
|
||||||
this._updateRefreshButton(isRefreshing);
|
this._updateRefreshButton(isRefreshing);
|
||||||
if (isRefreshing) {
|
if (isRefreshing) {
|
||||||
@@ -656,10 +658,14 @@ const App = {
|
|||||||
UI.hideProgress();
|
UI.hideProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
mc.scrollTop = 0;
|
|
||||||
await this.loadIncidentDetail(id);
|
await this.loadIncidentDetail(id);
|
||||||
|
|
||||||
|
// Zum Header scrollen und Animation wieder aktivieren
|
||||||
mc.scrollTop = 0;
|
mc.scrollTop = 0;
|
||||||
setTimeout(() => { mc.scrollTop = 0; mc.style.overflow = ""; }, 500);
|
requestAnimationFrame(() => {
|
||||||
|
mc.scrollTop = 0;
|
||||||
|
if (gridEl) gridEl.classList.add('grid-stack-animate');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren