New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting custom component results in focus error after selecting a date (this.input ref is null) #746
Comments
gpbl
added a commit
that referenced
this issue
Jul 7, 2018
gpbl
added a commit
that referenced
this issue
Jul 7, 2018
Thanks! And curiously enough I did not realize styled-components do not expose the focus method so for those who may come across this in the future, here are docs on setting up a styled-component to expose focus: |
Oh I see! Thanks for the heads up about styles-components, I wasn’t aware of that. |
kimamula
pushed a commit
to kimamula/react-day-picker
that referenced
this issue
Aug 17, 2022
kimamula
pushed a commit
to kimamula/react-day-picker
that referenced
this issue
Aug 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce:
Click within the input field, then select a date. Notice the errors appearing in the console.
Here's the repro:
https://codesandbox.io/s/jp60wk9jj3
Error:
Although in my local development environment I get this slightly different error:
In either case, it looks like the ref is null at this line:
https://github.com/gpbl/react-day-picker/blob/master/src/DayPickerInput.js#L371
Setting
keepFocus={false}
works around the issue.The text was updated successfully, but these errors were encountered: