-
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
More abstraction for accessible components #607
Comments
Is there a precedent for conditionally mixing something in? For instance, say sun/HSlider mixes in AccessibleSlider, which sets the accessible content and adds axon/Properties for clients. But if in some context we want a sun/HSlider to look like <div role="slider" tabindex="0></div>
with a custom set of listeners and Properties, we could have changes to the HSlider prototype or other things that we don't want. |
@jonathanolson responded with:
|
I really like the first suggestion in #607 (comment). It seems useful to be able to customize the accessible component with options, so that any portion of the content can be changed, rather than overriding specific behavior with another mixin. |
We should investigate and see how this feels, but I am wondering if this pattern would be overkill for the majority of accessible content. For instance, to create a button with the Accessibility mixin, you might do Node.call( this, {
// a11y options
tagName: 'input'
inputType: 'button'
accessibleLabel: 'Translatable Label'
} );
this.addAccessibleInputListener( { click: clickListener } ); Sliders are more complex, but most input elements tend to be this simple. |
With the first bullet in #607 (comment), we might have // in the constructor
this.initializeAccessibleButton( {
accessibleLabel: 'Translatable Label',
listener: clickListener
} );
// outside of constructor
AccessibleButton.mixin( MyButtonNode ); |
This relates highly to our work during this week's a11y sprint. Adding to a11y meeting. |
@jessegreenberg and I discussed this outdated issue today. There is nothing left here, we now have multiple mixins for a11y technology. |
In phetsims/john-travoltage#149 @jonathanolson said:
The text was updated successfully, but these errors were encountered: