-
Notifications
You must be signed in to change notification settings - Fork 398
feat(Slider): add experimental slider #1683
feat(Slider): add experimental slider #1683
Conversation
Deploy preview for carbon-components-react ready! Built with commit 6d88eed https://deploy-preview-1683--carbon-components-react.netlify.com |
src/components/Slider/Slider.js
Outdated
@@ -154,12 +153,6 @@ export default class Slider extends PureComponent { | |||
}; | |||
} | |||
|
|||
UNSAFE_componentWillReceiveProps(nextProps) { | |||
if (!sliderValuePropSync && !isEqual(nextProps, this.props)) { |
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 removal here seems a breaking change, please see: #1370
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.
Great progress @emyarod! Great to get in sync with TJ wrt the markup change.
src/components/Slider/Slider.js
Outdated
<span className={`${prefix}--slider__range-label`}> | ||
{formatLabel(max, maxLabel)} | ||
</span> | ||
{!hideTextInput && ( | ||
<TextInput | ||
type={inputType} | ||
id="input-for-slider" | ||
id={`input-for-slider${id}`} |
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.
We tend to use ${id}
as a prefix instead of a suffix (e.g. https://github.com/IBM/carbon-components-react/blob/v6.39.0/src/components/Select/Select.js#L31) - Wondering if it'd make sense to align the convention.
d09f186
to
37f63fa
Compare
37f63fa
to
16cb84a
Compare
c18724d
to
aff2cd8
Compare
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.
LGTM 👍 if the change works with v9
style. Do you think this is still blocked by #1681? Thanks @emyarod !
@asudoh probably is not blocked but the topic discussed in #1681 is still something to consider in the future I believe |
@asudoh the visual bug we are seeing in the React implementation is caused by the problem addressed in https://github.com/IBM/carbon-components-react/issues/1681 and #1684 Our React so we end up rendering <div class="bx--form-item">
<input>
</div> rather than just <input> |
aff2cd8
to
67f271d
Compare
@emyarod As we discussed the slider element order issue is caused by https://github.com/IBM/carbon-components/pull/1315/files#diff-f8f1a0577791a85d255a9cdf4e2f791fR30 - Did you see it differently, or were you talking about another issue? Any more background? |
@asudoh from what I can tell, the issue is caused by our https://github.com/IBM/carbon-components-react/blob/master/src/components/Slider/Slider.js#L464 removing this wrapper causes the input box to be positioned correctly I believe this line is also relevant in why a wrapper div would ruin the order of the elements https://github.com/IBM/carbon-components/pull/1315/files#diff-f8f1a0577791a85d255a9cdf4e2f791fR38 |
Thank you for the details @emyarod! I think the last link explains the issue the best. That said, when you remove the wrapper div, would you try adding |
67f271d
to
bd70265
Compare
@asudoh it looks like the new parent node already contains |
@emyarod Thank you for taking a look - Further investigation revealed that I was confused From that, I see two approaches to fix the problem:
Thoughts...? |
bd70265
to
39880cf
Compare
blocked by carbon-design-system/carbon#1640 |
4184c4e
to
9c97e21
Compare
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.
LGTM 👍 - Thanks @emyarod!
9c97e21
to
6d88eed
Compare
updated to include changes from carbon-design-system/carbon#1640 |
🎉 This PR is included in version 6.81.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes IBM/carbon-components-react#1682
This PR will add the new experimental slider changes
related https://github.com/IBM/carbon-components-react/issues/1681