Skip to content

Commit

Permalink
Fix #183
Browse files Browse the repository at this point in the history
  • Loading branch information
Minnowo committed Sep 28, 2024
1 parent 0202c1e commit f7494d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/src/timespan/DoneTrackers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ const DatedTimeSpans: React.FC<{
const ref = React.useRef<HTMLDivElement | null>();
React.useEffect(() => {
if (ref.current) {
setHeight((old) => ({...old, [name]: ref.current!.getBoundingClientRect().height}));
const currentHeight = ref.current.getBoundingClientRect().height;

setHeight((old) => {
if (old[name] === currentHeight) {
return old;
}
return {...old, [name]: currentHeight};
});
}
}, [ref, name, setHeight]);
return (
Expand Down

0 comments on commit f7494d1

Please sign in to comment.