-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[preact/compat] radix-ui Slider component drag points (Thumbs) not working #3666
Comments
So far I have been able to narrow it down to this useCollection, this |
Took a stab at this too. From what I can tell so far is that this is caused by a combination of re-renders and abusing function Foo() {
const [thumb, setThumb = useState(null);
// Ref is abused as a state setter.
return <button ref={(el) => setThumb(el)} />
} In the real code base there are a few abstractions in-between like the That can be answered by looking into how both frameworks deal with state updates during a commit is being batched. In Preact we just re-queue the component and once the queue is components is flushed (meaning all components finished rendering), then we fire all pending effects that that were scheduled via Problem is that during the rendering of the re-queued component which holds the The whole logic relies on this In React this works, because the effects seem to be executed before a re-queued element is rendered, instead of at the end when all components have been rendered. |
SliderPrimitive.Thumb が適切に動作しない ([radix-ui 側の issue](radix-ui/primitives#1601)) ([preact 側の issue](preactjs/preact#3666))
Describe the bug
Thumb (drag points) are not receiving any updates past the initial css applied.
To Reproduce
https://stackblitz.com/edit/nextjs-preact-webpack5-pjoxwh
Steps to reproduce the behaviour:
Load the stackblitz example above and drag the edges of the white lines:
While the line itself is adjustable, the
Thumb
components are not shown. If the nested span's css is modified fromdisplay: none
todisplay: block
theThumb
element is rendered on left edge with 0, 0 coords.Expected behavior
For slider thumbs to be attached to end of white line and to move along with them.
Additional context
Slider
component used to hang the app as did the Dialog in this bug report #3297. Since version10.10.1
and this #3645 fix specifically theSlider
component now no longer hangs the app but it's not 100% working either withThumb
component being broken.Same Issue reported in radix-ui repo radix-ui/primitives#1601
The text was updated successfully, but these errors were encountered: