mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
3.2k stars 132 forks source link

[ BUG ] Checkbox validation error in web showcase app #249

Closed tomhendra closed 4 days ago

tomhendra commented 4 days ago

Describe the bug When the only invalid FormField component is one that renders a FormCheckbox, submitting the form does not handle the validation error, and an error is observable in the browser console: TypeError: elm.focus is not a function

To Reproduce Steps to reproduce the behavior:

  1. git clone git@github.com:mrzachnugent/react-native-reusables.git
  2. Go to '/apps/showcase/app/form.tsx'
  3. Remove all FormFields apart from the one that renders <FormCheckbox label="Accept terms & conditions" {...field} />
  4. Run the dev server pnpm dev:showcase:web
  5. Open http://localhost:8081/form in browser
  6. Attempt to submit the form
  7. Observe no validation on screen & error in the console

Expected behavior The validation behaviour should work correctly.

Platform (please complete the following information):

Additional context Assume the issue is with ref forwarding. I have attempted to fix it, but can't seem to get there. Some help would be very much appreciated.

mrzachnugent commented 4 days ago

Hey @tomhendra, unfortunately the Form component is deprecated. You can still use it, but it's at your own risk.