perf: remove navbar remount key & add passive scroll/touch listeners

- Remove key={String(open)} from MobileNav container to prevent
  unnecessary full DOM remounts on every menu toggle (fixes #1098)
  The animate prop already handles border-radius transitions via
  Framer Motion so the key prop was redundant
- Add { passive: true } to all scroll and touch event listeners
  (fixes #1053)
  window.addEventListener('scroll') in Navbar and MobileNav
  document.addEventListener('touchstart') in click-outside handler
  window.addEventListener('scroll', true) in onboarding-tour (uses
  capture + passive since handlers only read geometry, no preventDefault)
This commit is contained in:
mac-agent 2026-04-05 07:05:03 -04:00
parent 6f6be19f9d
commit cbe463ae90
2 changed files with 3 additions and 4 deletions

View file

@ -598,7 +598,7 @@ export function OnboardingTour() {
};
window.addEventListener("resize", handleUpdate);
window.addEventListener("scroll", handleUpdate, true);
window.addEventListener("scroll", handleUpdate, { capture: true, passive: true });
return () => {
window.removeEventListener("resize", handleUpdate);