Skip to content

Commit e601a5f

Browse files
committed
fix: 修复 bubble 滚动条时的 bug
1 parent d996a86 commit e601a5f

File tree

1 file changed

+3
-3
lines changed
  • packages/umi-plugin-ui/src/bubble/Dragger

1 file changed

+3
-3
lines changed

packages/umi-plugin-ui/src/bubble/Dragger/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export default class Draggable extends React.Component {
4646
this.deltaX = 0;
4747
this.deltaY = 0;
4848

49+
this.defaultScrollBarSize = getScrollBarSize();
50+
4951
this.state = {
5052
dragged: false,
5153
width: 0,
@@ -233,12 +235,10 @@ export default class Draggable extends React.Component {
233235
if (!dragged || !!hide) {
234236
return;
235237
}
236-
237238
const scroll = getScrollOffsets();
238239
const clientWidth = getClientWidth();
239240
const clientHeight = getClientHeight();
240241
const { width, height } = node.getBoundingClientRect();
241-
242242
const left = clientX + scroll.x - deltaX;
243243
const top = clientY + scroll.y - deltaY;
244244
let right = clientWidth - left - width;
@@ -263,7 +263,7 @@ export default class Draggable extends React.Component {
263263
}
264264

265265
// for better performance
266-
node.style.right = `${right}px`;
266+
node.style.right = `${right - this.defaultScrollBarSize}px`;
267267
node.style.bottom = `${bottom}px`;
268268

269269
this.setState(

0 commit comments

Comments
 (0)