-
Notifications
You must be signed in to change notification settings - Fork 45.6k
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
Invalid operand to 'in': Object expected. [SelectEventPlugin.js in IE9] #694
Comments
It has something to do with double-clicks (as in the event), adjusting the double-click timeout in Windows makes the problem easier/harder to reproduce. After discussing a bit more in the chat, this most likely has to do with double-click triggering text selection, the element is then immediately removed and I'm guessing React tries to restore it for some reason, but the element is now gone, hence null as node. |
So the fix could involve the failing early return in |
@plievone Could I ask that temporarily switch to debug |
@colingourlay I can't reproduce in IE9 on your site. You're still seeing the problem? |
Fixes facebook#694. Previously, it could be that there was an active element that was removed in between mousedown and mouseup.
@spicyj Great! The source of the problem here is actually that when double-clicking on an X, you switch to edit mode for the entry, and the input is then removed immediately which confuses React. I'm assuming you attached double-click to the wrong node, and double-clicking on the text and not the remove button is what should cause the entry to become editable. |
Don't get selection if no active element
In IE9, when you use a button to trigger an event that deletes an element (containing that button), everything works as expected. However, if this event is an item in a list of similar elements, clicking the buttons in each element in quick succession triggers an error in this function:
react/src/eventPlugins/SelectEventPlugin.js
Line 66 in 8b0af9b
The error is:
Using IE9's debugging tools I've been able to discover that in this situation, the
node
argument is null. I can't work out if there is a problem with React's DOM representation, but can confirm that this is only a problem when you make multiple clicks within a few hundred milliseconds of each other. Taking your time doesn't trigger the error.Here's the website I'm getting this error on: http://colin-gourlay.com/25headlines. Try adding a few items, then removing them by clicking the X.
I'd submit a pull request that extends the condition in L66 to ensure node is an object, but I don't know enough about the overall architecture to know if the else blocks you currently have can handle this case, or if another is needed.
The text was updated successfully, but these errors were encountered: