Autocomplete onChange or onSelect
Closed this issue · 2 comments
temuccio commented
Hi all,
I have 3 element of form.
The first element is autocomplete. When I select one element of autocomplete, I need to call a POST request for get data can will put in 2nd and 3th elements.
How I can execute this functions? Do you have a call onSelect or onChange?
My autocomplete fields is named prest.
I have try with this code:
useEffect(()=> { console.log(form.watch('prest')); },[]);
but it can't show the difference when I select different elements.
fateh999 commented
For this, you can use
useEffect(()=>{ //Api call },[form.watch('keyname')])
There is no onSelect in this library
temuccio commented
Nice,
it works fine!
Thanks!!!