-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Prerequisites
- I have searched the existing issuesI understand that providing a SSCCE example is tremendously useful to the maintainers.I have read the documentationIdeally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
What theme are you using?
chakra-ui
Version
6.x
Current Behavior
The number slider of charka-ui does not work inside the playground demo page.
You will see that the slider does not work with mouse-input. However it will work with arrow keys (keyboard input) or with modifying the formData directly in the <textarea>
.
Expected Behavior
The slider should work with mouse inputs
Steps To Reproduce
- checkout the
rjsf-v6
branch npm install
cd packages/playground/
npm start
- open the Numbers tab and select chakra-ui theme
Environment
- OS: macOS 15
- Node: 22
- npm: 10
Anything else?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
heath-freenome commentedon Apr 30, 2025
@antpaw I'm looking at the chakra ui Slider docs and they have a very different implementation. Maybe you need to do something like what they have, breaking out the control into parts?
antpaw commentedon May 1, 2025
@heath-freenome thank you for looking in to this, can you explain what you mean by "very different"
https://github.com/rjsf-team/react-jsonschema-form/blob/v6.0.0-beta.1/packages/chakra-ui/src/components/ui/slider.tsx#L32
compared to this?
I've already tried to simplify the environment by a lot, basically I've setup the demo, you are referring to, inside of the widget without connecting its out- or in-puts to the system, and still the issue was exactly the same. If that demo would work inside the widget I could get to a point where where its clear what parts are causing the bug. But I can not get a working example inside the playground iframe no matter how simple I make it. However, outside of the iframe (in the same playground) the slider works. It must be some setting or a provider / wrapper element that is causing it. I don't think its the usage of the slider itself.
segunadebayo commentedon May 1, 2025
@antpaw you probably want to map the rjsf form props to those in Chakra v3
antpaw commentedon May 2, 2025
@segunadebayo thank you for looking into this!
I've already tried to simplify the environment by a lot, basically I've setup an example inside of the widget without connecting its out- or in-puts to the system (using the code that you have provided, but not even connecting the props, example at the bottom), and still the issue was exactly the same. If that example would work inside the widget I could get to a point where it's clear what parts are causing the bug. But I can not get a working example inside the playground iframe no matter how simple I make it. However, outside of the iframe (in the same playground) the slider works. It must be some setting or a provider / wrapper element that is causing it. I don't think its the usage of the slider itself.
heath-freenome commentedon May 8, 2025
@antpaw how can I help you resolve the issue?
antpaw commentedon May 9, 2025
@heath-freenome It would be amazing if you could create a simple example of a working slider inside the playground iframe. This example does not have to be connected to the "form-system" it just has to work with mouse events. It also does not have to leave inside a "field" and can be moved outside of the
<form>
. That would prove that the bug is caused by some parent component. And we can begin to move this element down into the<form>
step by step and than starting to connect it to the system and see where it starts to break[-]Number Slider does not work with mouse inputs[/-][+]Number Slider does not work with mouse inputs in playground[/+][-]Number Slider does not work with mouse inputs in playground[/-][+]chakra-ui Number Slider does not work with mouse inputs in playground[/+]heath-freenome commentedon May 23, 2025
@antpaw I'm pretty busy with work at the moment. Have you tried to see if it works inside of a codesandbox?
antpaw commentedon May 27, 2025
@heath-freenome I was able to narrow down the source of this bug slightly:
in
Playground.tsx
once wrapped in
<DemoFrame>
the same slider stops to work. That also mean that the production version is not affected for the most users.heath-freenome commentedon May 30, 2025
@antpaw so putting it into an
iframe
breaks things?! Hmmm, maybe it has to do with theDemoFrame
code here?:Which uses your code in
ChakraFrameProvider.tsx
. Maybe something else needs to be added to it?