Skip to content
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

Make setting of accessible attributes more consistent #958

Open
Tracked by #953
jessegreenberg opened this issue Mar 27, 2019 · 0 comments
Open
Tracked by #953

Make setting of accessible attributes more consistent #958

jessegreenberg opened this issue Mar 27, 2019 · 0 comments

Comments

@jessegreenberg
Copy link
Contributor

Part of #953, there are a few ways now to set accessible attributes (internally to scenery) on an AccessiblePeer. For example, to set the input value, Accessibility.js uses

           for ( var i = 0; i < this.accessibleInstances.length; i++ ) {
              var peer = this.accessibleInstances[ i ].peer;
              peer.onInputValueChange();
            }

But to mark something as checked, Accessibility uses setAttributeToElement

            this.setAccessibleAttribute( 'checked', checked, {
              asProperty: true
            } );

Discussing with @zepumph, we prefer to use setAccessibleAttribute directly to avoid a proliferation of functions on AccessiblePeer for numerous HTML attributes. But if the individual function on AccessiblePeer is doing more work it has more value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants