Migrate Slider#4986
Conversation
|
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
efb842a to
c7a2fff
Compare
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
Picasso design patterns check failed
|
|
📖 Storybook Preview 🚀 Your Storybook preview is ready: View Storybook 📍 Preview URL: This preview is updated automatically when you push changes to this PR. |
vedrani
left a comment
There was a problem hiding this comment.
There are also good things in this PR: alpha trick, solving position, better BASE UI structure, no owner state.
I plan to update my PR based on it and also address data-state and uncontrolled I commented here.
This PR needs to address design fixes regarding color and thumb and mark size.
|
|
||
| // We mirror the value internally so that marks and value labels can reflect | ||
| // the live value even when the component is used in an uncontrolled way. | ||
| const [uncontrolledValue, setUncontrolledValue] = useState<number | number[]>( |
There was a problem hiding this comment.
It's mirroring state. I understand it's because of uncontrolled way.
Btw did we supported uncontrolled way before migration?
I suggest we use BASE ui state as single point of truth.
There was a problem hiding this comment.
@vedrani I don't think we changed how component behaves, we keep the exactly the same Props 🤷♂️
| const containerRef = useRef<HTMLDivElement>(null) | ||
| const sliderRef = useCombinedRefs<HTMLElement>(ref, useRef<HTMLElement>(null)) | ||
|
|
||
| const setRootRef = useCallback( |
There was a problem hiding this comment.
Why not useCombinedRefs, it's not following convention.
There was a problem hiding this comment.
@vedrani does it do the same what useCombinedRefs do? I don't think so 🤔
| {marksData.map(mark => ( | ||
| <SliderMark | ||
| key={mark.value} | ||
| data-index={mark.value} |
There was a problem hiding this comment.
I think it should be mark index, not value.
There was a problem hiding this comment.
agree, but to me seems like "nit", we even didn't have that before 😃
[FX-NNNN]
Description
Describe the changes and motivations for the pull request.
How to test
Screenshots
Development checks
picasso-tailwind-mergerequires major update (check itsREADME.md)propsin component with documentationexamplesfor componentBreaking change
Alpha packages
Manually trigger the publish.yml workflow to publish alpha packages. Specify pull request number as a parameter (only digits, e.g.
123).PR Review Guidelines
When to approve? ✅
You are OK with merging this PR and
nit:to your comment. (ex.nit: I'd rename this variable from makeCircle to getCircle)When to request changes? ❌
You are not OK with merging this PR because
When to comment (neither ✅ nor ❌)
You want your comments to be addressed before merging this PR in cases like:
How to handle the comments?