Skip to content
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

manchette: drop extraneous scroll event listener #397

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ui-manchette/src/components/Manchette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,14 @@ const Manchette: FC<ManchetteProps> = ({
useIsOverflow(manchette, checkOverflow);

useEffect(() => {
window.addEventListener('scroll', handleScroll, { passive: true });
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('keyup', handleKeyUp);

return () => {
window.removeEventListener('scroll', handleScroll);
window.removeEventListener('keydown', handleKeyDown);
window.removeEventListener('keyup', handleKeyUp);
};
}, [handleScroll, handleKeyDown, handleKeyUp]);
}, [handleKeyDown, handleKeyUp]);

useEffect(() => {
const computedOperationalPoints = calcOperationalPointsToDisplay(
Expand Down Expand Up @@ -186,7 +184,7 @@ const Manchette: FC<ManchetteProps> = ({
style={{ height: `${height}px` }}
onScroll={handleScroll}
>
<div className="manchette-container ">
<div className="manchette-container">
<div
className=" bg-ambientB-10 border-r border-grey-30"
style={{ minHeight: `${INITIAL_OP_LIST_HEIGHT}px` }}
Expand Down
Loading