react-redux-form icon indicating copy to clipboard operation
react-redux-form copied to clipboard

Is there a way to listen to model changes on particular controls

Open tamas-pap opened this issue 7 years ago • 2 comments

Is there a way to listen to model changes directly on a control, instead of the whole form? It would be useful to know when a particular input changes.

I tried:

<Control.text model=".text" onChange={(e, field) => console.log(e, field)} updateOn="blur" />

but I don't think it was designed for it, since the callback function is called on every keystroke, not just on blur.

Thank you!

tamas-pap avatar Jan 22 '18 08:01 tamas-pap

Is that not giving the expected result? Are you looking to listen for model changes only on blur?

davidkpiano avatar Jan 22 '18 14:01 davidkpiano

Yes, exactly. I would love to know every time the model changes for the component with model=".text", and have a handler attached to it.

tamas-pap avatar Jan 22 '18 14:01 tamas-pap