Unverified Commit 2fa01886 authored by Tiefseemonster's avatar Tiefseemonster Committed by GitHub

fix: tooltip overlaps a window border (#599)

parent dd7d322c
...@@ -64,6 +64,11 @@ const UsageHeatMap = () => { ...@@ -64,6 +64,11 @@ const UsageHeatMap = () => {
tempDiv.style.top = bounding.top - 2 + "px"; tempDiv.style.top = bounding.top - 2 + "px";
tempDiv.innerHTML = `${item.count} memos on <span className="date-text">${new Date(item.timestamp as number).toDateString()}</span>`; tempDiv.innerHTML = `${item.count} memos on <span className="date-text">${new Date(item.timestamp as number).toDateString()}</span>`;
document.body.appendChild(tempDiv); document.body.appendChild(tempDiv);
if (tempDiv.offsetLeft - tempDiv.clientWidth / 2 < 0) {
tempDiv.style.left = bounding.left + tempDiv.clientWidth * 0.4 + "px";
tempDiv.className += " offset-left";
}
}, []); }, []);
const handleUsageStatItemMouseLeave = useCallback(() => { const handleUsageStatItemMouseLeave = useCallback(() => {
......
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
@apply text-gray-300; @apply text-gray-300;
} }
&.offset-left {
&::before {
left: calc(10% - 5px);
}
}
&::before { &::before {
content: ""; content: "";
position: absolute; position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment