Skip to content

Commit

Permalink
fix(*): use offset when positioning overlay, do not adjust range tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkahn committed Feb 22, 2019
1 parent b533dc6 commit ac22b05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/message/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
@include box-sizing;
@include message-bounding();

.#{$css-prefix}message-wrapper {
position: fixed;
left: 50%;
}

.#{$css-prefix}message-close {
color: $message-close-icon-color;
font-size: 0;
Expand Down
5 changes: 2 additions & 3 deletions src/overlay/utils/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ export default class Position {
}
}

// This will only execute if `pinElement` could not be placed entirely in the Viewport
const inViewportLeft = this._makeElementInViewport(pinElement, firstPositionResult.left, 'Left', isPinFixed);
const inViewportTop = this._makeElementInViewport(pinElement, firstPositionResult.top, 'Top', isPinFixed);

this._setPinElementPostion(pinElement, {left: inViewportLeft, top: inViewportTop});
this._setPinElementPostion(pinElement, { left: inViewportLeft, right: inViewportTop }, this.offset);
return expectedAlign[0];
}

Expand Down Expand Up @@ -244,7 +244,6 @@ export default class Position {
_getExpectedAlign() {
const align = this.isRtl ? this._replaceAlignDir(this.align, /l|r/g, {l: 'r', r: 'l'}) : this.align;
const expectedAlign = [align];

if (this.needAdjust) {
if (/t|b/g.test(align)) {
expectedAlign.push(this._replaceAlignDir(align, /t|b/g, {t: 'b', b: 't'}));
Expand Down
9 changes: 6 additions & 3 deletions src/range/view/range.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function LowerSlider(props) {
popupProps={{
visible: tooltipVisible,
onVisibleChange: onTooltipVisibleChange,
animation: tooltipAnimation
animation: tooltipAnimation,
needAdjust: false
}}
trigger={Slider({ ...props, value: value[0] })}
align="t"
Expand Down Expand Up @@ -63,7 +64,8 @@ function UpperSlider(props) {
popupProps={{
visible: tooltipVisible,
onVisibleChange: onTooltipVisibleChange,
animation: tooltipAnimation
animation: tooltipAnimation,
needAdjust: false
}}
trigger={Slider({ ...newprop, value: value[1] })}
align="t"
Expand All @@ -78,7 +80,8 @@ function UpperSlider(props) {
popupProps={{
visible: tooltipVisible,
onVisibleChange: onTooltipVisibleChange,
animation: tooltipAnimation
animation: tooltipAnimation,
needAdjust: false
}}
animation={{
in: 'fadeInUp',
Expand Down

0 comments on commit ac22b05

Please sign in to comment.