#Number Input formatting
22 messages · Page 1 of 1 (latest)
Because your parser regular expression handles only $
ok
@robust wharf I am building a search and filter page which will involve a lot of group checkbox, input fields, sliders, selects etc and sometimes 2-3 inputs will be synchronized with each other. should my i use form or should i deal with all the elements uncontrolled like onchange stuff.
with controlled i am experiencing a lot of rendering issues and updates issue
i am trying to synchronize two inputs with slider price but it goes into
infiinte loop due to form being rendered again and again maybe
this is an example of something a have done. I separated the 1 into many action the table on behind has many action it involves many check boxes . I am using tanstack table for the table behind. depends on my action different actions is produce. in this img is my of my actions I am selecting few rows from the tanstack table and sending it to the modal to produce a array. This array is
const form = useForm<ItestType[]>({
initialValues:
[{id:0,test1:'',test2:'',test3:'',test4:''}]
});
```,
from that form again I am doing different actions.
So maybe you can split you actions istead of grouping them and only send the data required for that action.
I will check the sandbox that you sent now
my sandbox is working fine but it is rendering again and again and devtools are giving warning. so performance issue
Thanks i will think about your suggestion
the issue is not in the sandbox because somewhere you are using the setpricerange. The place that you are setting the price range from it I am getting it is inside you effect. That use effect being activated every time a render happen. So it is setting the range then resetting it then resetting it.
share a screenshot of the code in SearchAndFilter on line 32 the issue is coming from there.
i think you have correctly identified the problem but i can't think of a way to solve this. i need two way binding when i changed inputs they should change the slider and vice versa
just to explain the issue for you as the solution will depend on you.
basically you are telling the browser when any item in my sliderPrice change go on and change the sliderprice first element and second element.
so here is the follows
step 1) change slider[0] to something
step 2) it goes in useeffect.
step 3) useeffect changes slider[0] and slider[1]
step 4) it goes back to step 2
so the solution depends on your use case. is there any reason why you are trying to set both values in the useeffect?
no there is no particular reason. as they are in form so i dont think any other to update the field values