-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix(Control): method binding for mouseUpHandler, mouseDownHandler, and actionHandler #9370
Conversation
Build Stats
|
721fcf7
to
d734f6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done apart for the TS thing that I am not sure I want to dig into - having an optional method that can be passed in option or defined on the instance
The methods do not get called bound to instance because the methods get the instance passed in as a parameter. |
I think the point was only to let you return a different function or let you run your own logic if for some reason you add 2 - 3 different functions you wanted to run depending on event status, object. It was just a possibility, if you have an actionHandler that does multiple things is not useful. |
Update Control.spec.ts
d734f6e
to
7b86dce
Compare
I don't assign them. |
This reverts commit 0c1312d. Update Control.spec.ts
0956992
to
e8070f3
Compare
This still feels weird. |
I thought so as well but wasn't sure about breaking the api |
yes let's keep this fix, and let's see later how important is this extra layer on top of the action themselves |
Motivation
Creating controls and subclassing them I found that I can't override actionHandler, mouseDownhandle, mouseUpHandler for 2 reasons:
Description
Bind the handler when getting them.
I must say I am not sure I understand the need og
getActionHandler
etc.Changes
Gist
In Action