Using controller with headless UI combo-box #11081
Unanswered
AlanGanser
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use react-hook-form with zod to validate whether the coordinates of a location falls within a polygon of coordinates. I'm using the react-hook-form controller component to try and register my combo-box, but I notice that react-hook-forms is not collecting any value from the combo-box. I'm not sure how to properly assign the onChange handler to my combo-box. I took a look at the docs and noticed that the argument of onChange() for the controller component didn't necessarily have to be an event, but when I look at the source code, onChange() takes an event. I suspect that my error is originating from that.
What I want to happen is react-hook-form to verify that the entered address lies within my defined polygon of coordinates. Here is a reproduction
for testing purposes, an address that lied within the polygon is 1701 N Copia St, El Paso, TX 79930, and an address that lies outside the polygon is 1600 Pennsylvania Avenue NW, Washington, DC 20500.
Beta Was this translation helpful? Give feedback.
All reactions