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

Add forwarding behavior functions for accessibleName and helpText #1665

Closed
jessegreenberg opened this issue Oct 28, 2024 · 1 comment
Closed
Assignees

Comments

@jessegreenberg
Copy link
Contributor

A common use case for accessibleNameBehavior is to forward the accessibleName to child Node. The pattern for doing that is a bit verbose. It would be nice to factor some of this out:

    node.accessibleNameBehavior = ( node: Node, options: ParallelDOMOptions, accessibleName: PDOMValueType, callbacksForOtherNodes: ( () => void )[] ) => {
      callbacksForOtherNodes.push( () => {
        otherNode.accessibleName = accessibleName;
      } );
      return options;
    }
@jessegreenberg
Copy link
Contributor Author

I started using these in a few components, I think they will be helpful. Closing.

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

1 participant