-
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
Can't remove accessibleInputListeners? #764
Comments
This is a different issue, Ill make an issue in scenery-phet, it should be a straight forward thing to add. |
@zepumph if you agree with #764 (comment) I can work on this. |
@zepumph and I discussed this. We are concerned that we are trading one "gotcha" for another. If we remove the wrapping, we will have to remember set We are not sure which is the greater evil. |
For this reason we are leaning toward removing the wrapping function as suggested by @jonathanolson originally. |
Confirmed with @jonathanolson, we are ready for implementation. @jessegreenberg whoever get's to this first. |
Also I added this to RichText (I had to use removeAccessibleInputListener): var tmp = this.addAccessibleInputListener( this.accessibleInputListener );
// "safe?" workaround for https://github.com/phetsims/scenery/issues/764
if ( this.getAccessibleInputListeners().contains( tmp ) ) {
this.accessibleInputListener = tmp;
} Which should remove the wrapped object and be kinda future-compatible. Probably should remove it when this is fixed. |
@jonathanolson is work in this issue the cause of phetsims/scenery-phet#369? |
Yes, I should have used |
I also have a workaround in place in ProportionalDragHandle.js (area-model-common). Both that and the RichText workaround should be removed when this is fixed. |
Searching for listeners added to |
Not set by check boxes or radio buttons, but those shouldn't need it:
Removing the setting in Accessibility.js and NVDA is still indicating which button is selected. AccessibleSlider and AppendageNode are already setting inputValue. |
Let me know if I can be of any more assistance. |
Thanks @zepumph, change made above so that addAccessibleInputListener is no longer wrapping the listeners in the passed in object. It is still returning the |
Here is the hits for
|
The above commits get everything except ProportionalDragHandle.js and RichText.js. |
@jonathanolson in those remaining cases, you added a check like if ( this.getAccessibleInputListeners().includes( tmp ) ) {
this.accessibleInputListener = tmp;
} I believe those can be removed now, but don't fully understand why they were necessary as a workaround. Can you please update those as you see fit? Once that is done, we can replace the return statement in return this; for chaining (to match |
I made them compatible with the old implementation AND the new implementation that would |
Removed the workarounds. |
Excellent, thanks @jonathanolson. @zepumph would you mind reviewing changes for this issue? In particular, this commit implemented the largest change: 2e6e7bc The rest are updating usages of addAccessibleInputListener across the project. |
I think this is nice, I like that you set it up so that you didn't have to change the usages in the dispose method. I like it when things work out like that. I think this is ready to close, @jessegreenberg please reopen if there are any other considerations. |
It's happening in sim code (not yet committed) where I need to add/remove KeyboardDragListeners, errors any time you try to add one, since the value put in
_accessibleInputListeners
is actually an object filled in from the listener, not the "listener" itself.Also note that when this is fixed, it should ideally be fixed in a way that doesn't modify the listener itself (i.e. it should be supported to add the same listener to two different nodes, right?)
As a side note, it's really weird having to create an entirely new KeyboardDragListener every time you want to change one of the deltas or its transform. I'll probably create an issue in scenery-phet for this. Also I see no way to interrupt one of those listeners.
The text was updated successfully, but these errors were encountered: