-
Notifications
You must be signed in to change notification settings - Fork 12
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
event.currentTarget is null in SimpleDragHandler 'drag' #66
Comments
I'm experiencing the same problem with ButtonListener 'over'. It occurs when I release the mouse with the cursor over the node. event.currentTarget is null, oldState is down'. I realize that this is probably because something is being handled via a pointer listener, but I think that needs to be transparent to the client. |
SimpleDragHandler (and other drag listeners) could overwrite currentTarget with the node the listener is applied to, if that would make things easier. |
Yes, please overwrite (fill in?) currentTarget in SimpleDragHandler. Ditto for ButtonListener and UpDownListener. From the client's perspective, these listeners are added to a node (not a pointer) so event.currentTarget should be valid. |
Discussed at 6/6/13 developer meeting, assigning this to me. |
I filled in currentTarget in DownUpListener, and ButtonListener requires no changes because it's a subtype of DownUpListener. JO reviewed it, and it's working in molarity and beers-law-lab. SimpleDragHandler is next, unless JO delivers better drag handler before I get to it. I'm planning to reorganize SimpleDragHandler a bit, move some of the code that's currently in the pointer listener into the SimpleDragHandler.prototype functions, so that all assignment to event.currentTarget are done in the prototype functions. With the current structure, assignments would be spread across pointer listener and prototype functions. |
Is this waiting on anything for me to do before the deadline, or should it be removed from the milestone? I can work on creating DragListener, but I don't see it as the highest priority right now. |
Since it's been another month and we haven't replaced SimpleDragHandler, I decided to fix this. @jonathanolson, could you please review the fix? |
This prints 'null':
Event.js says:
Perhaps in the implementation of SimpleDragHandler, 'drag' is firing on a pointer. If that's the case, it's not at all obvious to the client. If dealing with event.currentTarget in the 'start' and 'end', I would hope to be able to do the same in 'drag'. If I have to use event.currentTarget in one place and event.trail another, that's unfortunate.
The text was updated successfully, but these errors were encountered: