-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: tweak above the fold wording #1839
Conversation
jobenjada
commented
Dec 29, 2023
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
apps/formbricks-com/components/shared/Header.tsxListening to the scroll event can be expensive in terms of performance, especially if the event handler performs complex operations. In this case, the event handler is simple, but it's still a good practice to throttle or debounce the event to reduce the number of times the handler is called. useEffect(() => {
const handleScroll = throttle(() => {
if (window.scrollY > 250) {
setStickyNav(true);
} else {
setStickyNav(false);
}
}, 200);
window.addEventListener("scroll", handleScroll);
return () => {
window.removeEventListener("scroll", handleScroll);
};
}, []);
It's a good practice to provide a skip link at the beginning of the page. This allows keyboard users to skip directly to the main content, bypassing the header navigation. return (
<>
<a href="#maincontent" className="sr-only focus:not-sr-only">
Skip to main content
</a>
<Popover className={`${stickyNavClass}`} as="header">
...
</Popover>
</>
);
|
…nto lp/tweak-wording