-
Notifications
You must be signed in to change notification settings - Fork 344
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 temperature slider based on HTML range input #1757
Conversation
@patrickhlauke |
@jongund Just a visual nit - the length of the Fan slider (range input) and the Heat/Cool slider (range input) are the same, but the Fan slider should be longer because it has 4 labels, and the Heat/Cool slider only has 3. (Interestingly, they are a bit longer in FF, and a bit shorter in Chrome.) |
for this and the other two: i'll check these over the weekend, if that's ok time-wise |
@patrickhlauke |
General comment: I'd love to see these examples use
(though that will then also require some tweaking of the table styles to avoid them pushing out the content/leading to horizontal scrolling of the whole page) to make the experience a bit more mobile/small-screen friendly. This example works very well on a Surface touchscreen, on iPhone/Safari, reasonably in iPhone/Chrome (seems the webview used for Chrome gets a bit flakey with respecting the Android/Chrome/TalkBack announces percentage only when focusing a thumb. Users can change value by double-tap-and-hold-ing the thumb, then moving their finger. Changing percentage value is announced when moving. The fact that it only announces percent values becomes confusing/an issue in the Fan and Heat/Cold examples. Hearing that "Fan" is at "25 percent" is even more meaningless to users in this case. Yes, it's a shortcoming in TalkBack of course, but at least in the case of a numeric slider that represents a range of values, it can "almost" be understandable (though without knowing min/max either, yeah, it's of low information value for these users). Incidentally, I'm actually wondering if using sliders for these two cases is semantically appropriate. They're not really offering a sliding scale of values that the user jumps between, but conceptually they are mutually exclusive radio buttons? Lastly, as these examples use an actual |
and yes, the fact that the slider for "Fan" was visually shorter than the labels/buttons underneath it was confusing, visually |
for some reason, Chrome/TalkBack also didn't announce the actual displayed temperature in the |
Perhaps we can discuss this tomorrow. I'm thinking that our HTML examples should exactly mimic an ARIA example. I'm not sure which slider would be best to mimic. I think it would be ideal if it were one that required the least amount of JS and ARIA. When deciding which one, it seems to me that Minimizing JS would be more important than the number of ARIA attributes. That would rank implementations that don't use valuetext higher .... unless there is some creative way of using valuetext without a script. |
@mcking65 Jon |
@mcking65 |
perhaps listening to |
@patrickhlauke yes, that is what we talked about at the meeting. Change event is more reliable/stable than input event. |
@patrickhlauke |
I just brutally grabbed your example, slotted it into codepen, and replaced on both platforms, using AT, the visible celsius value is changed, so the event is fired properly even when triggered by AT https://codepen.io/patrickhlauke/pen/4b3f6b49d2bd1889ecc99e1f08b6545e |
<div class="range-value">25.0°C</div> | ||
<input type="range" | ||
id="id-temp-range" | ||
class="veritcal" |
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.
typo in class name, and not actually used. just remove the whole class="veritcal"
here
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.
Thanks, I will update
@patrickhlauke |
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.
As discussed before, Narrator in Scan mode, unable to change the temperature values.
From the keyboard support section of the example:
There are some editorial issues with this text, i.e. it should be "by multiple steps", and if 18 steps represents 1.8 degrees, "e.g." isn't appropriate because that's just a fact of the implementation rather than an example. However, I don't understand the intention here overall.
|
@jscholes |
@jongund That will make this example impossible to test within ARIA-AT, has really poor usability, and IMHO sets a pretty bad precedent for including instructions within APG examples that may only work as described in certain situations. I suggest that Page Up/Down be overridden to either:
I don't like option 2, but either way we need examples to be predictable in a way that allows them to be documented and tested. CC @mcking65, @sinabahram and @IsaDC |
the standard behaviour for as if programmatically forcing the value to something "nicer", authors would likely need to explicitly specify what a "nice" step is - perhaps with a how about, as an alternative: don't specify in the description/instruction what the big step for |
ARIA-AT tests are explicit about the outcome that should be achieved and tested for. When assessing assistive technology behaviour, we must have a known value to assert against. So the vague notion of it moving by more than the step amount isn't sufficient. If it can be guaranteed that the Page Up/Down step will be 2.8 in all browsers, we can test that. But heuristics are the enemy of precise testing, not least because the behaviour may change underneath us in the future. From a usability perspective, 2.8 degrees is also likely to seem completely arbitrary to most users operating a temperature control. So I maintain that the current behaviour is problematic. |
@jscholes wrote:
James, Our goal in ARIA-AT is only to test that the assistive technology behavior is appropriate. Of course, we can't test something that does not conform with standards. In addition to conforming with standards, for keyboard behavior, we expect implementations to be consistent with the APG patterns. In this case, the browser behaviors for Page Up and Page Down are consistent with the APG slider pattern. ARIA-AT should be flexible enough to accommodate testing experiences that vary due to browser implementation details as long as those variances do not violate any standards or explicitly contradict the APG guidance. In this case, using a heuristic to test screen reader response to Page UP and Page Down can precisely test the screen reader behavior even if different browsers vary slightly in their implementation. Of course, members of ARIA-AT could discover and raise issues related to the usability of browser implementations of AT--related behavior. In doing so, though, I want to be careful that we don't imply that the ARIA-AT project somehow dictates how browsers should work in order to make experiences usable for people who rely on assistive technology. If the browser implementation directly contradicted the APG pattern, then we would have an APG issue to resolve. Either the APG Task Force could work through the browser developers or Open UI to influence the browser experience, or the APG could adjust, or there could be a middle of the road solution that adjusts both. I don't think we should add keyboard scripting to this example. With our HTML examples, we want to illustrate the accessibility you get with as little ARIA and JS as possible. |
I'm not sure what's being suggested here in concrete terms. If the ARIA-AT assertions for this pattern must be generalised to not reference a specific new value when it is increased and decreased, I'm not sure how that should be automated or worded for human testers. You wrote:
How should that be achieved without a reference value to test against? I.e. what is the meaning of "appropriate" if we don't know what the output will be across browsers? If we include the notion of the value being higher or lower than it was before, that won't adequately test screen reader behaviour. For instance if the new value is 27.8, and JAWS for some reason only announces 27 or 27.7, how will the tester know not to pass the assertion? Alternatively, are we saying that the ARIA-AT project needs to define the expected outcome on a per-browser basis for some tests, and adapt the wording of assertions accordingly? If so, the infrastructure is currently not in place to do that, because the test format only allows distinctions to be made on a per-AT level. I don't want to suggest that the ARIA-AT project should not accommodate behaviour that is defined by browsers and therefore may differ across engines. As we move more towards testing HTML semantics as well as explicit ARIA, these questions will have increasing importance. But the facilities are not explicitly in place at present, so this may be a good use case to facilitate exploring them. |
@mcking65 wrote:
@jscholes wrote:
Isn't the aria-at assertion just that the screen reader announces the current value after the keyboard command is executed? The assertion doesn't have to include the value. It is the same assertion for up/down/pageUp/PageDown. We just need a setup that ensure that the value actually changes. I don't know what we assert if the value doesn't change. @mcking65 wrote:
@jscholes wrote:
I think appropriate is "current" in this case. @jscholes wrote:
We don't need to include higher/lower if the requirement is that the screen reader announce the current value. @jscholes wrote:
Definitely not saying we need to have browser-specific assertions. Hope I'm not overlooking something and consequently oversimplifying. |
I may just be misinterpreting your intent here. But how does a tester, human or otherwise, determine that the value voiced by a screen reader is correct if we don't tell them what it should be? I.e. if the screen reader speaks a value that differs from the previous one, but it doesn't actually represent the current value of the slider because of a screen reader bug: with the proposed approach of only asserting that a change in value is announced, the tester would have to indicate that the screen reader had passed the test, even though it had actually failed. This was a weakeness of some early test plans, e.g. checkbox, where testers were told to uncheck and check the checkbox in a single test, and the assertion was worded as: "Change in state is conveyed". This was fundamentally not sufficient, because it didn't prepare for a case whereby the screen reader announced a new state, but not the right one. As such, those earlier plans are being reworked to be more compatible with automation (and better for it). The only way a tester could provide any meaningful data for such assertions is to listen to the screen reader output, then inspect the element to make sure that the current state, value, etc. matched what the screen reader said. That is obviously not tenable. Again, I may be missing something so I'm happy to talk through it further. Although this is probably not the best forum for a detailed ARIA-AT discussion, so maybe one for the CG meeting. |
@jscholes wrote:
I think aria-at testers, whether people or machines, should be able to determine the correct current value.
There we changed the test itself, e.g., check an unchecked box. But, the end is the same, assert that the screen reader reports the current state. Since it is binary, the new current state is predetermined. I agree that makes knowing the precise outcome possible. I don't think that should be a requirement for all tests because it would to severely constrains what aria-at can test. This example is exhibit A.
AX tree inspection is not the only path for a human tester. It might be the best path for a machine.
Yes, this is now an aria-at discussion. I believe that aria-at should be able to test this example as is and should not place any additional requirements on it. There is one assistive technology requirement related to sliders that I forgot about -- some screen readers have commands for changing slider value. Since those are screen reader functions, we'll need to test them in aria-at. This will get a bit complex because we will need to assert that swipe up with VoiceOver changes the slider one step and swipe up with 3 fingers changes it a larger amount. So, in that case, the change in value is one of the assertions. If 3-finger swipe up in chrome is different from 3-finger swipe up in safari, we do end up with a complex situation. With this specific example, we will run into that problem in macOS. However, VO on macOS does not have an equivalent to 3-finger swipe up unless using a touchpad; there is not a VO keyboard command equivalent to Page UP or Page Down. |
@jscholes |
@jongund Currently, yes. That is my main concern. I do think the example would be more usable if the step for Page Up/Down was explicitly defined as 1 degree or 2 degrees, rather than 2.8 which is:
However that's not a hill I'm willing to die on, if it's been decided that this example is more intended to demonstrate the technical merit of a native HTML element with minimal scripting, rather than the recommended level of usability for a component in production. As an ARIA-AT stakeholder, my primary aim is to ensure testability, and I welcome the opportunity to discuss possible ways to address the concerns outlined in this thread. |
This example uses
input[type=range]
using aria-valuetext and aria-orientation.The slider focus group meeting suggested a range control example using aria-valuetext would be useful for people to compare with slider widgets.
Preview Link
Review checklist