Skip to content

Commit ac22b05

Browse files
committed
fix(*): use offset when positioning overlay, do not adjust range tooltip
1 parent b533dc6 commit ac22b05

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/message/main.scss

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
@include box-sizing;
1010
@include message-bounding();
1111

12-
.#{$css-prefix}message-wrapper {
13-
position: fixed;
14-
left: 50%;
15-
}
16-
1712
.#{$css-prefix}message-close {
1813
color: $message-close-icon-color;
1914
font-size: 0;

src/overlay/utils/position.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ export default class Position {
110110
}
111111
}
112112

113+
// This will only execute if `pinElement` could not be placed entirely in the Viewport
113114
const inViewportLeft = this._makeElementInViewport(pinElement, firstPositionResult.left, 'Left', isPinFixed);
114115
const inViewportTop = this._makeElementInViewport(pinElement, firstPositionResult.top, 'Top', isPinFixed);
115-
116-
this._setPinElementPostion(pinElement, {left: inViewportLeft, top: inViewportTop});
116+
this._setPinElementPostion(pinElement, { left: inViewportLeft, right: inViewportTop }, this.offset);
117117
return expectedAlign[0];
118118
}
119119

@@ -244,7 +244,6 @@ export default class Position {
244244
_getExpectedAlign() {
245245
const align = this.isRtl ? this._replaceAlignDir(this.align, /l|r/g, {l: 'r', r: 'l'}) : this.align;
246246
const expectedAlign = [align];
247-
248247
if (this.needAdjust) {
249248
if (/t|b/g.test(align)) {
250249
expectedAlign.push(this._replaceAlignDir(align, /t|b/g, {t: 'b', b: 't'}));

src/range/view/range.jsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function LowerSlider(props) {
2727
popupProps={{
2828
visible: tooltipVisible,
2929
onVisibleChange: onTooltipVisibleChange,
30-
animation: tooltipAnimation
30+
animation: tooltipAnimation,
31+
needAdjust: false
3132
}}
3233
trigger={Slider({ ...props, value: value[0] })}
3334
align="t"
@@ -63,7 +64,8 @@ function UpperSlider(props) {
6364
popupProps={{
6465
visible: tooltipVisible,
6566
onVisibleChange: onTooltipVisibleChange,
66-
animation: tooltipAnimation
67+
animation: tooltipAnimation,
68+
needAdjust: false
6769
}}
6870
trigger={Slider({ ...newprop, value: value[1] })}
6971
align="t"
@@ -78,7 +80,8 @@ function UpperSlider(props) {
7880
popupProps={{
7981
visible: tooltipVisible,
8082
onVisibleChange: onTooltipVisibleChange,
81-
animation: tooltipAnimation
83+
animation: tooltipAnimation,
84+
needAdjust: false
8285
}}
8386
animation={{
8487
in: 'fadeInUp',

0 commit comments

Comments
 (0)