-
Notifications
You must be signed in to change notification settings - Fork 185
Set rheostat-disabled css class if slider is disabled
#144
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
base: master
Are you sure you want to change the base?
Conversation
src/Slider.jsx
Outdated
| classNames.push(props.orientation === 'vertical' | ||
| ? 'rheostat-vertical' | ||
| : 'rheostat-horizontal'; | ||
| : 'rheostat-horizontal'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ); needs to be on a line by itself; perhaps a cleaner option is classNames.push(orientation), or const classNames = ['rheostat', orientation] after the ternary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/Slider.jsx
Outdated
|
|
||
| return ['rheostat', orientation].concat(props.className.split(' ')).join(' '); | ||
| if (props.className) { | ||
| classNames = [...classNames, ...props.className.split(' ')]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classNames.push(...props.className.split(' ')), but this should probably be using the cx package instead of manually splitting :-/
| } | ||
|
|
||
| if (props.className) { | ||
| classNames.push(...props.className.split(' ')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this should use the cx package instead of split.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't introduced manual splitting, it had been there before. Probably it's worth doing that but looks like it's out of scope of this pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
It would be convenient to have
rheostat-disabledin case of slider is disabled. It gives ability to specify css rules to distinguish active and disabled states.