Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong handle position when scaled #279

Closed
Jcqt-390 opened this issue Jun 6, 2017 · 2 comments · Fixed by #293
Closed

Wrong handle position when scaled #279

Jcqt-390 opened this issue Jun 6, 2017 · 2 comments · Fixed by #293

Comments

@Jcqt-390
Copy link

Jcqt-390 commented Jun 6, 2017

The slider handle is not placed at the right position when it is scaled.

Step to reproduce : Place the slider inside a scaled div

const wrapperStyle = { width: 400, margin: 50,transform:scale(0.5) };
ReactDOM.render(

Slider with custom handle

Range with custom handle

`${value}%`} />
, document.getElementById('__react-content') );

I changed line 211 in lib/common/CreateSlider.js and it works for me :

Prev : return this.props.vertical ? slider.clientHeight : slider.clientWidth;
Now : return this.props.vertical ? slider.getBoundingClientRect().height : slider.getBoundingClientRect().width;

@dbryand
Copy link

dbryand commented Jun 21, 2017

Hi @paranoidjk, I just submitted a PR for this. Would appreciate if you could take a look as this is blocking me from using in production (and I don't want to have to go find another slider--this one is great!) Thanks for all of your hard work!

captbaritone pushed a commit to captbaritone/slider that referenced this issue Jul 1, 2017
paranoidjk pushed a commit that referenced this issue Jul 3, 2017
* Fix #279 - Use getBoundingClientRect for proper scaled width of slider

* Fix width mocking in tests.

Fix mocking of `getBoundingClientRect`.
@paranoidjk
Copy link
Member

Fixed in rc-slider@8.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants