Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: remove `100%` height from tooltip container to fix layout issues (#3980)

David Luzar6dd0e6a4c511
diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsx
index 126fd24b35..7c3f9e237b 100644
--- a/src/actions/actionCanvas.tsx
+++ b/src/actions/actionCanvas.tsx
@@ -160,7 +160,7 @@ export const actionResetZoom = register({
};
},
PanelComponent: ({ updateData, appState }) => (
- <Tooltip label={t("buttons.resetZoom")}>
+ <Tooltip label={t("buttons.resetZoom")} style={{ height: "100%" }}>
<ToolButton
type="button"
className="reset-zoom-button"
diff --git a/src/components/Tooltip.scss b/src/components/Tooltip.scss
index 6411b2d70e..e40f81e619 100644
--- a/src/components/Tooltip.scss
+++ b/src/components/Tooltip.scss
@@ -29,7 +29,6 @@
// wraps the element we want to apply the tooltip to
.excalidraw-tooltip-wrapper {
display: flex;
- height: 100%;
}
.excalidraw-tooltip-icon {
diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx
index 409676bde6..fc1c69c5fd 100644
--- a/src/components/Tooltip.tsx
+++ b/src/components/Tooltip.tsx
@@ -62,9 +62,15 @@ type TooltipProps = {
children: React.ReactNode;
label: string;
long?: boolean;
+ style?: React.CSSProperties;
};
-export const Tooltip = ({ children, label, long = false }: TooltipProps) => {
+export const Tooltip = ({
+ children,
+ label,
+ long = false,
+ style,
+}: TooltipProps) => {
useEffect(() => {
return () =>
getTooltipDiv().classList.remove("excalidraw-tooltip--visible");
@@ -84,6 +90,7 @@ export const Tooltip = ({ children, label, long = false }: TooltipProps) => {
onPointerLeave={() =>
getTooltipDiv().classList.remove("excalidraw-tooltip--visible")
}
+ style={style}
>
{children}
</div>