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

Slider: custom styles for handle #19073

Closed
1 task
ops1ops opened this issue Sep 30, 2019 · 6 comments
Closed
1 task

Slider: custom styles for handle #19073

ops1ops opened this issue Sep 30, 2019 · 6 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@ops1ops
Copy link

ops1ops commented Sep 30, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Change handle width and height to 25px (for example)
  2. Focus ant slider and change value from default
  3. Change tab in browser or just use alt-tab
  4. See that slider value changes

What is expected?

Slider's value shouldn't change

What is actually happening?

I dont really understand what is happening, but the same styles on rc-slider works well and considering that ant slider uses rc-slider probably problem is in ant styles, but i'm not sure

Environment Info
antd 3.23.5
React react 16.8.6
System Ubuntu 18.04.3 LTS
Browser Chrome 76.0.3809.100
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Oct 3, 2019
@ant-design-bot
Copy link
Contributor

Hello @ops1ops. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @ops1ops, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@ops1ops
Copy link
Author

ops1ops commented Oct 4, 2019

@afc163

Edit on CodeSandbox

@afc163 afc163 added 🐛 Bug Ant Design Team had proved that this is a bug. and removed 🤔 Need Reproduce We cannot reproduce your problem labels Oct 5, 2019
@shaodahong
Copy link
Member

shaodahong commented Oct 8, 2019

The reason is .ant-slider-handle class has a marginLeft, if you change handlewidth, should be together changed marginLeft, In your example you can add margin-left: -12.5px; style, but in rc-slider new version, used transform, so I send a PR update rc-slider version and remove marginLeft

https://github.com/react-component/slider/blob/62b949f39f3edc6da657e1a720392d74193f34fb/src/Handle.jsx#L81

@yoyo837
Copy link
Contributor

yoyo837 commented Oct 14, 2019

@shaodahong Has #19120 fixed this?

@shaodahong
Copy link
Member

yep, but #19206 merged will be auto close it

@afc163 afc163 closed this as completed Oct 14, 2019
@yoyo837
Copy link
Contributor

yoyo837 commented Oct 14, 2019

Aha, my bad. It's on the feature branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants