You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NumberInput seems to disregard "autoFocus" prop. I was previously using refs to manage focus, but ran into issues when I started using react-dnd (drag and drop). Also, using refs is frowned upon in React.
Any chance that you can add autoFocus support?
The text was updated successfully, but these errors were encountered:
After further research, I realize now that this is not a react-number-input issue, but rather a React issue. I confirmed that react-number-input does in fact pass-through autoFocus to input as desired.
However, React doesn't act on autoFocus as one would hope. Further, it appears that you need to use refs for selecting/focusing among multiple input fields: facebook/react#5534
In case anyone else is looking for a possible solution to using refs to select inputs with react-dnd, read on...
Instead, I was able to modify my use of refs such that they were only created and accessed within the children/grandchildren/etc. (or parent/grandparent/etc.) of ConnectDragSource or ConnectDragTarget-wrapped components. Just stay away from creating or using refs within the wrapped component itself.
NumberInput seems to disregard "autoFocus" prop. I was previously using refs to manage focus, but ran into issues when I started using react-dnd (drag and drop). Also, using refs is frowned upon in React.
Any chance that you can add autoFocus support?
The text was updated successfully, but these errors were encountered: