-
Notifications
You must be signed in to change notification settings - Fork 97
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
Uncaught TypeError: Cannot read property 'current' of null #52
Comments
I found that opthers have the same erros as I do, not sure were to begin to fix it though: Any ideas? |
So I figured out the issue. Select2 doesn't like when its being re-rendered from react during the onChange callback. I had to put a It might be worth doing that in the wrapper itself, or working it around as its most likely going to happen to all users. |
Can you show full example code code for reproducing that? |
@hakunin can you provide more info on where you put the setTimeout? I'm also getting the same error |
FYI, I never had this issue until I updated from 0.6.1 to 1.0.3, and when that happened the select2 library went from 4.0.2 to 4.0.3. |
More info: 1.0.0 is the latest version that works without getting the error. 1.0.1 didn't get there error either, but it wasn't really working correctly so I think there was a bug with that version? |
@flynfish in the onChange callback. Upon changing it, the select2 in my example is re-rendered which I is likely the reason. |
@hakunin can you provide a code snippet? |
Is there a fiddle with the wrapper linked I could fork? |
The timeout workaround somehow stopped working for me. In the select2 issue there seem to be some other workaround, but the issue persists. select2/select2#3992 |
Hi, My workaround is to use both
Something like this:
|
Hi, I am not sure if I am using it wrong, but this is what I get when selecting any option.
The text was updated successfully, but these errors were encountered: