react-hook-form-mui icon indicating copy to clipboard operation
react-hook-form-mui copied to clipboard

Custom onBlur function never gets called for TextFieldElement

Open tkbeal opened this issue 1 year ago • 1 comments

https://github.com/dohomi/react-hook-form-mui/blob/472902d3ca38ae4e0db181e33d939e18b7f80e82/packages/rhf-mui/src/TextFieldElement.tsx#L133

Disclaimer: (I've not made an issue before so please go easy on me. I can provide further evidence if necessary to support the issue)

tl:dr; I believe onBlur for TextFieldElement is not allowing for user-defined onBlur function to trigger.

image

With my current setup, I never see the console log during onBlur event. I believe this is because, unlike onChange, onBlur handler in codebase is not checking for and calling any custom onBlur function, even if defined.

I haven't checked, but I suspect this could also be an issue for other element types too, not just TextField.

tkbeal avatar Jun 10 '24 21:06 tkbeal

yes currently the onBlur is not propagated, would be a simple fix. Will try to handle this sometimes soon

dohomi avatar Jun 11 '24 09:06 dohomi