Changeset cf0de0c in Klonkt


Ignore:
Timestamp:
06/20/2026 08:21:47 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
d8c6a83
Parents:
1c6d61c
Message:

fix(nav): syncAria also on pcmsNav + delayed retry (htmx race)

syncAria sometimes ran on htmx:afterSettle before the body class update →
Timeline/Grid stayed incorrectly active after an htmx click (e.g. to the
calendar). Now syncAria also fires on pcmsNav (fires after the class update)
+ 60ms retry to handle OOB-swap races.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    r1c6d61c rcf0de0c  
    397397  }
    398398  syncAria();
    399   // Re-sync after HTMX brings in new content (e.g. navigating back to home)
    400   document.body.addEventListener('htmx:afterSettle', syncAria);
     399  // Re-sync after HTMX brings in new content (e.g. navigating back to home).
     400  // pcmsNav vuurt ná de body-class-update (zie de pcmsNav-listener hierboven), dus
     401  // dáár weet syncAria de juiste pagina-class — los van de afterSettle-timing.
     402  // Een vertraagde herhaling wint eventuele resterende races (OOB-chrome-swap).
     403  document.body.addEventListener('htmx:afterSettle', function(){ syncAria(); setTimeout(syncAria, 60); });
     404  document.body.addEventListener('pcmsNav', function(){ syncAria(); setTimeout(syncAria, 60); });
    401405
    402406  // Pages where the body actually has a feed to toggle. On these the
Note: See TracChangeset for help on using the changeset viewer.