mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
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:
parent
6f6be19f9d
commit
cbe463ae90
2 changed files with 3 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue