-
Notifications
You must be signed in to change notification settings - Fork 350
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
Develop example of a tri-state toggle button #535
Comments
Hey, I’d like to work on this. I have a few questions. The examples on Button Examples are not organized well. I would like to separate the example JS/CSS into their own directories (i.e. Also, I wonder what the correct spelling of tristate/tri-state is. The spec language uses I’m also having a hard time figuring out what a good example might be for a tri-state toggle button. My concept looks like this: A sound control with the following elements:
The main button is the one that can exist in three states ("true", "false" and "mixed"). Toggling it cycles through the two usual states of a toggle button, "true" and "false". Whenever the main button is toggled, the dependant buttons receive the same state (e.g. turning off "Sound" also turns off "Audio" and "Vibration"). The dependant buttons are able to bring the main button in the "mixed" state. This happens whenever the dependant buttons don’t share the same state. Otherwise, the main button will receive the shared state of the dependant buttons. What do you think? Originally, I thought I could implement the tri-state buttons that are commonly used for phones’ audio control: Tapping the button cycles through the modes "Sound", "Vibration" and "Silent". However, the specification doesn’t allow a toggle button to trigger the "mixed" state on itself (reference). |
@kleinfreund commented:
Excellent! Thank you! And, thank you for raising your questions and proposal specifics here before working on a PR. BTW, sorry for the long delay with the answers. We were burning the midnight oil for the last several weeks to get the first release out, which is happening today! This example is currently in the plan for the release next Spring.
It would be fine to create separate css and js files, but we have been leaning toward a flatter directory structure. For example, look at the structure of the grid example directory. That would mean, for instance, having:
To keep the supporting documentation on the example page simpler, we have been preferring one example per page. I am OK with a single PR or doing it in stages. It is easier to review small changes. But, if you are waiting around on a review and merge to continue, that could slow you down, especially over the next few weeks with the holidays and other end of year/start of year work that will delay reviews.
Agree.
Good catch in the spec language there. Regardless, the design of the example needs to consider how a toggle will be announced by a screen reader. Here's another thought. Perhaps we have a set of buttons:
|
Hello there. Some things happened (e.g. dev machine died) and I wasn’t able to work on this when I wanted to. Anyway, I will now start with part 1 which is cleaning up the existing material (code, potentially language). That will be a separate pull request without new content but changes to existing content. In part 2, I’ll implement the example for the tri-state toggle button. I’ll get back to this issue with my thoughts on what example to use when the time is right. I just looked at the existing JavaScript and wondered if there is some kind of style guide that is being used apart from the editor config in the repository. For example: function init () { Space between function name and |
I had a look at the
|
Philipp, Thank you for taking on this issue. I really appreciate it!! @kleinfreund commented:
Please see the code conformance section of the readme. We use eslint to enforce js formatting.
We also have a code style guide in the wiki for the following ...
Omit on self-closing tags.
Omitted.
It's there so that the key commands have row headers for screen reader users. It is much easier to read that table with a screen reader with the th elements. I didn't realize they were overriding the kbd styling.
All the example pages use a common template. The task force decided on this after trying both ways. The previous format was you describe. The purpose of the current format is to help make it more clear to which element the states and properties are applied. |
In preparation for developing examples for tri-state toggle buttons (see issue #535). * Fixes indentation issues in the markup * Removing type="text/javascript" (some scripts have it, some don’t. I chose one.) * Removed / in the meta charset tag (some examples have it, some don’t).
The ARIA 1.1 specification refers readers to ARIA Practices for examples of toggle buttons that have
aria-pressed="mixed"
.Add an example of a tri-state toggle button to the button examples page
and add appropriate guidance to the button design pattern.
The text was updated successfully, but these errors were encountered: