Feature suggestion: Focus on first errored field #715
Replies: 6 comments 12 replies
-
+1 it's also useful when you have a form that is scrollable, as focusing the element will scroll that element into view. This is something that react-hook-form does, but it only works with input elements. One idea could be to pass a ref to some metadata of the field and then be able to access that metadata after validation occurs. Then I could add my own focus/scroll implementation:
|
Beta Was this translation helpful? Give feedback.
-
Does anyone have news about this? I would gladly provide a PR that changes this, but I don't understand the reasoning yet. Can we always trigger that, regardless of any changes being applied between two submit attempts? |
Beta Was this translation helpful? Give feedback.
-
@Balastrong @crutchcorn would be really cool if we could get an update on this. what's the recommended approach or is it straight up not feasible right now? |
Beta Was this translation helpful? Give feedback.
-
another usecase for focus-management: when adding a new entry to an array field with |
Beta Was this translation helpful? Give feedback.
-
With the most recent version of TanStack Form, this is how I solved it:
|
Beta Was this translation helpful? Give feedback.
-
The use-case that landed me here is a combo input, for which I wanted to unfocus (blur) the input on selection. I think it would be cool to have an API to do that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This would improve the accessibility of the form
Beta Was this translation helpful? Give feedback.
All reactions