-
Notifications
You must be signed in to change notification settings - Fork 435
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
Skip extra listener for non-Flash platforms #3023
Conversation
Checking |
can you provide small, complete test case that highlights the benefit of this change? |
Sure thing! |
I made another change to make sure it functions correctly when the Here's a simple project that includes a When you swap between the current the new code, everything should properly react. The primary benefit is that an extra event listener is no longer added to every button instance. I've noted some occasions where the event listener can cause the "onUp" event to be fired twice, which can cause issues. Please let me know if you encounter any differences or have any concerns. Because of the order of handling, this may resolve #1370. |
I haven't checked the demo yet, but one fear i have pertains to this: /**
* Using an event listener is necessary for security reasons on flash -
* certain things like opening a new window are only allowed when they are user-initiated.
*/ I've also experienced similar restrictions on browsers This also seems like its 2 or 3 changes rolled up into one and I'm not sure what each change is trying to fix Edit: I looked at the demo, I do not see any issues that need fixing |
I left the onUp check for Flash since it likely still requires it, so Flash should function the same. The extra code added to The end goal is for buttons to function as they currently do, but without an extra event listener, freeing up memory and preventing execution order errors. |
Again, I've noticed the same requirements on browsers meaning html5 should not have this removed |
Oh, I see what you're saying! I thought you meant browsers as in Flash within a browser. I can continue to test HTML5 functionality between different browsers. What would be a good test case for this? When it says open a new window, does it mean something like |
Yeah i've specifically seen this error when opening a url, I'd also like to know more about this issue about events firing twice before I make a change like this for all projects. perhaps this should be an opt-in setting? |
I understand the cause for concern! So far I've had no issues on Firefox or Chrome when using I noticed that not adding the additional onUp callback listener stopped this from happening. Other than for Flash, it made sense to not add an extra callback if it was no longer necessary. Let me know if you have any issues with HTML5. What would be the best way to make this opt-in? Edit: I need to look into #2201 because it may be tangentially related. |
6241e37
to
e721fca
Compare
Adding an extra listener can cause callbacks to fire twice in rapid succession, causing errors. The Flash version may still require this, so the listener is retained for that platform.