Skip to content

Commit 3460f0f

Browse files
byevalyouluna
authored andcommitted
fix(Range): add window.pageXOffset when calculate (#1289)
fix(Range): consider window.pageXOffset when calculating start
1 parent 8cbbdaa commit 3460f0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/range/view/range.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import classNames from 'classnames';
22
import React from 'react';
33
import PropTypes from 'prop-types';
4-
import { events, func, KEYCODE } from '../../util';
4+
import { events, func, KEYCODE, dom } from '../../util';
55
import Balloon from '../../balloon';
66
import { getPercent, getPrecision, isEqual, getDragging } from '../utils';
77
import Scale from './scale';
@@ -428,7 +428,7 @@ export default class Range extends React.Component {
428428

429429
const { tempValue } = this.state;
430430
const range = this.dom;
431-
const start = range.getBoundingClientRect().left;
431+
const start = dom.getOffset(range).left;
432432
// used in unit test
433433
let width = range.clientWidth;
434434
if (!width) {

0 commit comments

Comments
 (0)