Skip to content

Commit 3b688c0

Browse files
committed
Fix incorrect tooltipBottomOverflow
1 parent 9ccc18e commit 3b688c0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/packages/tooltip/tooltip.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const TooltipArrow = (props: {
2828
classNames.push("bottom");
2929
break;
3030
case "right":
31-
if (props.tooltipBottomOverflow) {
31+
if (props.tooltipBottomOverflow.val) {
3232
// In this case, right would have fallen below the bottom of the screen.
3333
// Modify so that the bottom of the tooltip connects with the target
3434
classNames.push("left-bottom");
@@ -37,7 +37,7 @@ export const TooltipArrow = (props: {
3737
}
3838
break;
3939
case "left":
40-
if (props.tooltipBottomOverflow) {
40+
if (props.tooltipBottomOverflow.val) {
4141
// In this case, left would have fallen below the bottom of the screen.
4242
// Modify so that the bottom of the tooltip connects with the target
4343
classNames.push("right-bottom");
@@ -226,7 +226,7 @@ const alignTooltip = (
226226
case "right":
227227
tooltipLeft.val = `${targetOffset.width + 20}px`;
228228

229-
if (tooltipBottomOverflow) {
229+
if (tooltipBottomOverflow.val) {
230230
// In this case, right would have fallen below the bottom of the screen.
231231
// Modify so that the bottom of the tooltip connects with the target
232232
tooltipTop.val = `-${tooltipHeight - targetOffset.height - 20}px`;
@@ -237,7 +237,7 @@ const alignTooltip = (
237237
tooltipTop.val = "15px";
238238
}
239239

240-
if (tooltipBottomOverflow) {
240+
if (tooltipBottomOverflow.val) {
241241
// In this case, left would have fallen below the bottom of the screen.
242242
// Modify so that the bottom of the tooltip connects with the target
243243
tooltipTop.val = `-${tooltipHeight - targetOffset.height - 20}px`;
@@ -353,7 +353,7 @@ export const Tooltip = (
353353
// windowSize can change if the window is resized
354354
const windowSize = dom.state(getWindowSize());
355355
const targetOffset = dom.state<Offset>(getOffset(element));
356-
const tooltipBottomOverflow = dom.derive(
356+
const tooltipBottomOverflow = dom.derive<boolean>(
357357
() => targetOffset.val!.top + tooltipHeight.val! > windowSize.val!.height
358358
);
359359

0 commit comments

Comments
 (0)