-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
console.log(syntheticEvent) causes "caller attempted to invoke a non-existent view method" error #210
Comments
Based on React SyntheticEvent doc that's not valid event:
https://reactjs.org/docs/events.html#mouse-events So |
@ilionic that's right, we currently have a non-standard onMouseDrag feature: https://github.com/nick-thompson/blueprint/blob/master/react_juce/core/View.cpp#L249. I think in the long run we will want to remove it for closer parity to the web standards, but for now it's in there. The problem is not that we're missing a If you follow along from that line in View.cpp that I linked above, you'll find that we walk through a few cpp helper calls before eventually landing right here in our javascript lib: https://github.com/nick-thompson/blueprint/blob/master/packages/react-juce/src/lib/Backend.ts#L222. This is how we make sure to invoke whatever So right there we have the problem: the synthetic view events that we bubble up to the user callback props don't get wrapped in this proxy that I highlighted on line 123, so how are we landing at a call to Let me know if that provides helpful context, I can elaborate further if it's helpful, but worth knowing that this issue will certainly involve going pretty deep into the internals here! |
Will post some findings. Don't have a full picture yet and continue digging but brains already fried :) Found that such behaviour of |
Great @ilionic sounds like you're on the right path definitely. |
repro steps:
For example:
run your app and initiate a drag event
You'll see something like the following error:
Additional Context
I added a breakpoint right before the exception and noticed it was a call to
toJSON
that was the "non-existent view method"And patching
SyntheticMouseEvent.toJSON
fixes the issue. Something like:For additional context see this Discord thread
The text was updated successfully, but these errors were encountered: