Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
renderonSeekSliderThumb, the seek slider ignored clicks and drags. The thumb's render branch replaced Base UI's thumb ref with the forwarded ref, so the slider never registered the thumb. On a press, Base UI looks for the thumb closest to the pointer, finds none, and drops the press:SeekSliderThumb render={(thumb) => <div {...thumb} />} - render({ ...baseProps, ref: forwardedRef, … }) // drops Base UI's [forwardedRef, listItemRef, thumbRef] + <Slider.Thumb ref={forwardedRef} render={(baseProps) => render({ ...baseProps, … })}> Slider.Control onPointerDown startPressing - thumbRefs is empty → no pressed thumb → getFingerState returns null → no value change + closest thumb found → value set from the pointerKeyboard seeking still worked, because the thumb's hidden input handles arrow keys itself.
SeekSliderTrackandSeekSliderProgresshad the same ref override. It was harmless there, because Base UI's track and indicator only take the forwarded ref, but they now use the same shape as the thumb.Writing the test showed a second problem in the same branches.
SeekSlider,SeekSliderTrack,SeekSliderProgress,SeekSliderThumbandVolumeSliderdropped their JSX children when givenrender, so<SeekSlider render={…}><SeekSliderControl>…</SeekSliderControl></SeekSlider>drew an empty slider. They now passchildrenthrough to Base UI, which also places the thumb's children next to its hidden input.The
refinSeekSliderTrack.RenderProps,SeekSliderProgress.RenderPropsandSeekSliderThumb.RenderPropsis now optional. That matches what Base UI passes, since it leavesrefunset during server rendering.Evidence
New browser test,
seek-slider.browser.test.tsx. It draws the slider three ways: withoutrender; with every part's children inside its render callback (the shape that failed in Ship); and withrenderplus JSX children. For each, it presses at 75%, drags from 20% to 50%, and presses ArrowRight.VolumeSliderclick also fail.bun run testfor@bazza-ui/reactpasses in full: 66 files, 1541 tests.type-checkandcheckare clean.Merge Danger
Door: two-way
Blast Radius: small
The change only touches the render-prop branches of the seek and volume sliders. Their default branches are unchanged. One case changes on purpose: a consumer who passed both
renderand JSX children used to get the children dropped, and now sees them rendered.