Closed
Description
Describe the feature you'd like:
As part of https://gist.github.com/bvaughn/d3c8b8842faf2ac2439bb11773a19cec I'm revisiting a lot of selector APIs from different libraries.
The API of ByRole
stood out with regard to role selection and its options.
Suggested implementation:
- Constraint
role
tostring
match fallback roles (e.g.Leaving for now. Not so clear what's the best default herebyRole('none') === byRole('presentation')
in<div role="none presentation" />
- Remove
exact
option - Remove
normalizer
option
Describe alternatives you've considered:
Document concrete use cases (motivated by real-world tests). If you have some, please let me know.
Teachability, Documentation, Adoption, Migration Strategy:
We can document fallback role matching in a footnote. I expect that most queries will not be concerned with fallback roles.
Constraining the API makes teaching this query easier.