From 4601db2ac187b22e57e8279241e750fe20f8dd35 Mon Sep 17 00:00:00 2001 From: shuang Date: Sun, 16 Jan 2022 11:39:18 +0800 Subject: [PATCH] bugfix/tooltip_wrong_position: fixed --- src/components/tooltip/Tooltip.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js index e2d3b1049..d673eb477 100755 --- a/src/components/tooltip/Tooltip.js +++ b/src/components/tooltip/Tooltip.js @@ -132,6 +132,10 @@ function align(el) { alignTop(el); if (isOutOfBounds(el)) { alignBottom(el); + + if (isOutOfBounds(el)) { + alignTop(el); + } } } else if (modifiers.left) { @@ -144,6 +148,10 @@ function align(el) { if (isOutOfBounds(el)) { alignBottom(el); + + if (isOutOfBounds(el)) { + alignLeft(el); + } } } } @@ -152,6 +160,10 @@ function align(el) { alignBottom(el); if (isOutOfBounds(el)) { alignTop(el); + + if (isOutOfBounds(el)) { + alignBottom(el); + } } } else { @@ -164,6 +176,10 @@ function align(el) { if (isOutOfBounds(el)) { alignBottom(el); + + if (isOutOfBounds(el)) { + alignRight(el); + } } } }