zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
883 stars 231 forks source link

[Question] Use of `position: absolute` for marks #203

Closed loichuder closed 3 years ago

loichuder commented 3 years ago

First of all, thanks for the nice package. I was happy to land on it after a few unsuccessful tries with other packages.

Description

I tried the recently added marks and noticed an odd behaviour: position: absolute must be explicitly set by the external CSS of the marks for them to be properly placed (see image and sandbox below).

On the other hand, tracks and thumbs do not need this as the position: absolute is already set by ReactSlider itself: https://github.com/zillow/react-slider/blob/master/src/components/ReactSlider/ReactSlider.jsx#L946 and https://github.com/zillow/react-slider/blob/master/src/components/ReactSlider/ReactSlider.jsx#L957.

Is this the expected behaviour or should ReactSlider set position: absolute for the marks as well for consistency ?

CodeSandbox

image

Edit zillow/react-slider

stonebk commented 3 years ago

I agree, the inconsistency is not great. It would probably make sense to add the positioning like we do with tracks and thumbs.