-
Notifications
You must be signed in to change notification settings - Fork 599
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
chore: add flipper spec #2862
chore: add flipper spec #2862
Conversation
specs/flipper/flipper.md
Outdated
- `fast-flipper` | ||
|
||
*Attrs* | ||
- `hiddenFromAT` - The control is hidden from assistive technology. Defaults to true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback is welcome on a better name here :). Per previous comments by @EisenbergEffect, something like hiddenFromAssistiveTechnologies
is a bit verbose. As an FYI, this convention was used here as an initial stub because the same language is often used by the W3C spec to denote when something is not exposed to AT users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could maybe do something like:
@attr({attribute: "aria-hidden"})
public hiddenFromAT: boolean = true;
Then then user could simply write <fast-flipper aria-hidden="false" />
to override. Note that this doesn't seem to actually work - aria-hidden is overridden by the default property value but I think that might be a bug. You might also need to do write a custom converter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Overwriting built-ins may not be something we can support. I'm not sure. It would be nice to use aria-hidden if we can. Do we need to do anything in our own code in response to this changing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it just needs to be hidden by default - perhaps when connected we could just check to see if the attribute exists, and if not set it imperatively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting idea. What do you think @chrisdholt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if aria-hidden
exists on the host, use that value and respond accordingly. If it doesn't exist, set aria-hidden in connectedCallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicholasrice @EisenbergEffect just want to confirm I'm understanding the proposed implementation (above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed offline, I like this idea and think we should pursue it in implementation. 👍
40667b6
to
d6a1937
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move ahead with this. We may just need to do some experimentation around the aria-hidden scenario. Ideally, I think we want to just enable aria-hidden to work, but to provide a default value for that. The trick is that we don't want to overwrite the built-in, but we do want to get change callbacks. I'm not sure if the platform is going to let us do that. I can play with some things. If we can't make that work, we can always fallback to the original proposal of using hiddenFromAT
.
Also, we could set up a MutationObserver on the host and observe attributes, but that seems a bit overkill if we can avoid it.
specs/flipper/flipper.md
Outdated
- `fast-flipper` | ||
|
||
*Attrs* | ||
- `hiddenFromAT` - The control is hidden from assistive technology. Defaults to true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Overwriting built-ins may not be something we can support. I'm not sure. It would be nice to use aria-hidden if we can. Do we need to do anything in our own code in response to this changing?
``` | ||
<template | ||
role="button" | ||
aria-hidden=${x => x.hiddenFromAT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just let the end user decide by adding aria-hidden themself or is there something we need to do internally in response to the hiddenFromAT property changing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of this depends on how we want to default it. If you default it to being exposed to assistive tech, then you need to drop the tabindex and add aria hidden in the event you want to hide it. If you default to hidden from assistive tech, the end user needs to add tabindex, override the internal aria-hidden behavior, and add the role of button. It's shown as persisting above, but I don't think we would add that if it were not exposed to AT. So, in a sense it's a swing of 3 properties on the implementors side to successfully transition between these states. I see a single prop to toggle this as a value add for empowering accessibility; however, we'd technically be empowering it as well by making someone handle it themselves.
0b80d38
to
37ef089
Compare
Description
This PR proposes adding a new spec for a flipper component.
Issue type checklist
Is this a breaking change?
Process & policy checklist