Do I need to use aria-label on elements that have visible labels which are read by screen reader? - wai-aria

My company is trying to become WCAG compliant. One of the things we need to do is add aria-label to interactive elements. My question is do I need to add an aria-label to an element which already has a label which is read by a screen reader.
So basically i definitely need a "close" aria-label here:
<button>x</button>
But in some cases I have a placeholder for example, which is read by the screen reader. Do I need to add an aria-label anyway just in case? The aria-label would be the same as the placeholder.

#mikkel has good advice regarding the first rule of ARIA use.
Regarding your specific question on the placeholder attribute, relying on the placeholder as your label would fail several WCAG checkpoints.
Placeholder text is typically light gray and when displayed on a white background often fails 1.4.3 Contrast Minimum
The placeholder text disappears when you start typing so now the "label" has disappeared and would fail 3.3.2 Labels or Instructions
The placeholder attribute is not specifically referenced in the accessible name calculation (https://www.w3.org/TR/accname-1.1/#step2) although it might be considered in step 2D as "an attribute that defines a text alternative". It's not clear if placeholder is a "text alternative". Personally, I don't think it is. If not, then you would fail 4.1.2 Name, Role, Value
If you look at the spec for placeholder, it has a big disclaimer about not using it as a label.
Warning: Use of the placeholder attribute as a replacement for a label can reduce the accessibility and usability of the control for a range of users including older users and users with cognitive, mobility, fine motor skill or vision impairments. While the hint given by the control’s label is shown at all times, the short hint given in the placeholder attribute is only shown before the user enters a value. Furthermore, placeholder text may be mistaken for a pre-filled value, and as commonly implemented the default color of the placeholder text provides insufficient contrast and the lack of a separate visible label reduces the size of the hit region available for setting focus on the control.
So, all that being said, yes, you should have some kind of visible label associated with your input field even if you are using the placeholder attribute.

Short answer, no.
Long answer, it depends on the situation.
But important – first rule of aria:
If you can use a native HTML element or attribute with the semantics and behavior you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so.
When in doubt, choose native HTML.
https://www.w3.org/TR/using-aria/#rule1
If you have a visible label, then you should connect the label text and the input field via the label-element.
If the input field does not have a visible label, the aria-label is one technique that can add the label semantically.
In your example of the button, you should use an aria-label, as the "X" doesn’t give the user any information. Of course, most users can guess what an "x" dos, but the user should not have to guess.
And here am talking of users who use assistive technology.
I would recement that you get a professional to test your site, for legal reasons but mostly for your users.
I'm a web developer, but have used the last 10 years on web accessibility. So far, it’s the hardest field of web development I hav had to learn and I'm still learning. 😊

Related

UIPath Robot won't type into a text box, clear selector. Clicking separately and sending hotkeys also does not work

I've tried nearly anything, The "Type Into" activity won't print plain text into the text box let alone a held variable. The textbox element in question is the update work items comment box in the acme-test website from the Level 3 RPA developer course. I am able to type into the box manually and the robot is able to find it (the cursor moves to the centre of the text box and the program continues). I've tried quite a lot, including using a click activity and then sending the string as hotkeys.
Most probably the issue is related to your selectors. Since you are on level 3 RPA developer course I assume you are using Reframework for the task and I believe because of comprehensive error handling capabilities of this template your application just continuous with the next item instead of crashing when it can't find the element.
To solve the selector issues I usually do the following:
Use partial selectors instead of full selectors
Use wildcards for dynamic parts of your selectors (* for replacing any number of characters, ? for replacing exactly 1 character)
You can also store the page you are working on in a Uipath.Core.Browser type variable to eliminate the need of reselecting browser.
Also keep in mind that if you have used basic recorder functionality of UI path it generates full selectors.

Protect a range of text in ScintillaNet: what is the best way to do it?

I know that styles have an attribute to allow/avoid changes in the text in which they are applied:
SCI_STYLESETCHANGEABLE(int style, bool changeable)
However, the documentation says "This is an experimental and incompletely implemented style attribute.", which seems it is not "production-ready"
I think there is another alternative, using "Indicators":
To protect a range of text, we could apply an specific indicator to it and in keydown event detect "del" & "backspace". If the character that follows current position (caret position) in "del" case or that precedes current position in "backspace" case has this indicator, then we must cancel the event and do not erase the text.
Which of this 2 alternatives is better? There is another better way?
Note: ScintillaNet is based on Scintilla and I assume that the extensive documentation of the last one is valid for both.
I share with you one of the responses in "scintilla-interest" google-groups that published Neil Hodgson, the creator of Scintilla.
[Ian G.]> SCI_STYLESETCHANGEABLE is what I tried initially before I resorted to writing this patch. The only real disadvantage I can see is that in cases like my own it doubles the number of styles needed because every visual style that can occur in a writeable region can also occur in a protected region, but I could live with that.
[Neil Hodgson] It would be better to use an indicator for protected areas since they are relatively space efficient and avoid doubling the number of styles.
complete post in scintilla-interest

Xcode's Accessibility Label vs Hint vs Id

I searched but could not find an up-to-date question, so here goes:
Could someone let me know what Xcodes Accessibility Label vs Hint vs Id are used for? I think it might be label and hint are used for voiced navigation and Id's are only used for automation, but not sure if that is right?
You are correct.
The 'Label' property will be used in voice over representing the element itself. If Labels are not set manually, they will be filled in at runtime based on the content of the element. IE: "Comment Delete Button"
'Hints' are also used in voice over assistance but are a more descriptive representation of the element. IE: "This button allows users to delete a comment."
'identifier' is used for automation and quick query of the UI element.
IE: "CommentDeleteButton"
The Label and Hint can be localized and therefore will vary between languages while the identifier remains the same.
https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/iPhoneAccessibility/Accessibility_on_iPhone/Accessibility_on_iPhone.html#//apple_ref/doc/uid/TP40008785-CH100-SW1

Descriptive label names in a desktop application

I have an application that displays a dialog when the user needs to enter information. The reason for this, is to keep the main form readonly, and only when you need to add/edit data will a dialog appear.
The problem I'm wrestling with is what to display for the label names in the dialog. The application is a WPF desktop app and traditionally desktop apps are very short on label names (usually one or two words). I want to make the dialog user friendly and be more descriptive about the information that is required. Web developers seem to be catching on to this and are much more descriptive with their label names, but most of the forms I've looked at are forms that are only filled in once, whereas I will have data that can be edited.
An example: If I had a label that asked a user if an employee smoked, in most a destop apps the label would normally be something like 'Smokes?' with a checkbox, whereas I want something like 'Does the employee smoke?'. My issue with this is, that the first time you come across this dialog and enter the data, then it seems OK, but what about when you are editing data that is already there. Does this label now make any sense. Past tense and present tense seem to be getting in my way and I was interested in what people think or ways they have approached this. The application I'm writing is a WPF app and I feel that traditional label names are a bit old in the tooth now.
Another example would be entering contact details for a person. Do I just have labels that say Phone, Fax, Email or something more descriptive. i.e. a label that appears before the textboxes stating 'Enter the contact details below' and then the single word labels?
Maybe I'm just being pedantic about all this, but I would like to take a step forward so that my application contains more than single word labels that are sometimes unclear to the user about what is required.
Why not make use of the concise labels and use Tool tips for a longer explanation.
The longer explanation is only required when a user is unfamiliar with the application anyway.
Also, you could re-word a label to make it sound more like a question such as "Is a Smoker?"
Since you are using Stack Overflow, take note of their use of tooltips, I think Jeff Attwood has a blog post or comments in a podcast about the use of tooltips in SO. I can't remember where I heard / read it.
Have you thought about creating a "quickstart" flow or wizard for entering data for the first time? This would give you the opportunity to guide the user through the process, using labels with descriptions, so that they learn to associate the description with the label you've chosen (hopefully something succinct but intuitive). Then when they need to edit data, they have learned the application taxonomy.
If you are running into issues with tenses, steer clear of using verbs or only use the present tense. I would try using nouns - "smoker?" instead of "smokes?"
When you're asking for common data like phone numbers, email addresses, you can probably assume that the user will understand what you mean. Just be clear as to whose contact information you are asking for - using a title for the field set that is explicit is a good idea ("Employee Contact Details"), adding a short description above the field set will help too.
Of course, you should always do some level of usability testing on your application before you launch it to uncover any issues with the interface.

How can I enhance the aesthetics of an ugly windows form packed with too many (necessary) features?

One of the window dialog of a software I'm working on looks a bit like this : (original screen-shot copied from this coding horror post, other examples available on this SO question)
The thing is that none of the options can be removed (those who can have already been), and that they must all be visible at a glance (i.e. no tabs allowed) Edit : I've added a comment explaining why tabs are not an option in my specific project.
I've tried to use colors, to add icons, but it just added to the overall feeling that someone had just dropped controls randomly using Visual Studio Form designer during a summer internship.
How can I make this dialog more user-friendly less horrifying without deleting features ?
Edit :
The GUI example I took has a lot of obvious design flaws (see those answers 1 2), but even after fixing those (which I've done on the software I'm working on), the dialog still looks pretty ugly.
Below is another example (credit). Controls are (almost) lined up correctly, appropriate controls are used, etc, but the overall result still looks terrible :
(source: judahhimango.com)
Given the constraints I think you won't have many options.
A good starting point would be to equal the alignments and control distances to increase overall symmetry with the ultimate goal to reduce visual clutter.
Examples:
The group boxes "Special" and "Running options" should have equal height.
The distances between the four buttons "Save settings" and "Exit" should be equal.
All buttons should have the same height, if possible avoid word wrapping.
Use the same height for all single-line edit boxes.
The quota label and its text field should be at the same baseline.
The distance between a group box caption and its first control should be equal (compare "Running options" to "Retrieval options")
Increase the distance between the controls in general, i.e. make the form look less dense.
Content fixes:
Use the same captions/names for the same things. For example, you use "Append to logfile" but "Overwrite Logfile
Use the same character case, sometimes it's "Only the first one", "Every Single Word" and sometimes "it is Camel-cased". Decide on one scheme and use it consequently (Sentence case and Title case are the most common)
Don't try to be cool, "Go 2 background" doesn't look very professional.
Avoid controls with unreadable shortcuts or no content at all. It doesn't help if the user has to stop on every control and think: "What does this thing do?"
Some more radical/controversal changes:
Try making the group boxes more symmetric, possibly be re-positioning them and use the same height. If necessary use two columns of checkboxes, that would still look better than uneven group boxes.
Unless it's absolutly necessary, remove the horizontal scroll bars from the two multiline edit boxes
Get rid of the "Clear" buttons. For the list box on the buttom left you have to provide some other way to delete items, perhaps make this into a multine text box, too.
Try replacing the checkbox collection with a checkable list box or a property grid.
A rule of thumb:
Imagine the lines of the bounding box of each control lengthed until it reaches the form boundary. The less different lines reach the boundary, the better. (Because correctly aligned controls produce more incident (-> less unique visible) lines)
On the use of colors and icons:
Simply adding icons and colors doesn't solve the fundamental problems such forms have. They all suffer from being overloaded with controls and adding even more only worsens the problem, because they just add more visual noise, but don't provide any more visual cues.
The problem with your examples, and the reason that they look cluttered is that there's not enough spacing between the elements. You think you're saving space by making things smaller, and putting them closer together, but it's a false economy because your eyes have to work harder to differentiate elements from eachother. Think about writing a computer vision program that had to OCR those interfaces, and the challenges you'd have just figuring out which element was which, let alone what the type says.
Regardless of what your programmer efficiency instincts might say.. it's okay to put space between your elements, and hell, it's okay to even have large amounts of completely "wasted" space too.
have a look at this
There's a clear boundary between the flower and its background. The shallow depth of field of the photography gives a clear contrast, and allows you to very rapidly construct a mental sillouette.
jungle http://www.statravelbuzz.co.uk/wp-content/jungle-taranaki-new-zealand.jpg
what's going on in this image? There's too much detail, and it's all over the place.
have a look here
http://www.papress.com/thinkingwithtype/text/line_spacing.htm
(source: papress.com)
think about what the line spacing is doing to your ability to distinguish words from eachother. What's it doing to the visual sense of clutteredness?
You can see from the type example that you don't have to give up much in terms of space efficiency to see massive gains in visual appearance.
grid systems
grid systems http://ecx.images-amazon.com/images/I/51kcWOOyUoL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg
thinking with type
other reccomendations:
stop stealing sheep
elements of typographic style
the design of everyday things
the humane interface
If you've already dealt with alignment and organizational aspects as much as you can, then your problem probably is the graphic design of the controls. Heavy 3-D controls in large numbers are detrimental to the aesthetics and usability of a window. Consider editing their properties to flatten and lighten the controls’ appearance, using something I call “compact presentation.” In addition to removing the ugliness and distraction of heavy borders and backgrounds, this also allows controls to be placed closer together, freeing white space for grouping them without resorting cluttering lines and frames.
It looks something like this (after also fixing alignment and redundancy along with a little re-arrangement of groups):
(source: zuschlogin.com)
If you're on WinForms, One trick I've found useful is to pack multiple-instance data in a DataGridView, and single-instance data in a PropertyGrid. Both these controls help you pack lots of information in very small space, and still give you full control over their visualization (you can add descriptions, tooltips, etc.)
The thing is that none of the options
can be removed (those who can have
already been), and that they must all
be visible at a glance (i.e. no tabs
allowed)
Sigh. I would argue that, because everything is visible at a glance, they practically become invisible in a sea of controls.
That being said, the ff (yes another list) are my suggestions:
To reduce clutter, make the overall form bigger, and all controls more widely spaced apart in all directions
Standardize the height of the controls, e.g., textboxes must all have same height, buttons all have same height, etc
Align labels with text boxes more consistently
Make the layout flow down instead: 1 column, with each group having the same width as all other groups
Set all group box names in bold to make them stand out
Put all those "wGetStart.bat" commands in a group of its own
If you really want to learn more about making it "flow", with or without getting rid of all this "visible" information, you might wanna get a copy of Steve Krug's Don't Make Me Think:
Because tabs are not allowed, you can create a more grid like layout.
Adding detachable panes for related options and commands can help the user to organise them, at least. If they can be minimised/unpinned when not needed, then they can also free up valuable screen estate and unclutter the UI. See VisualStudio itself for a nice implementation.
Here's my random selection of suggestions:
make it bigger, this allows a more structured grouping by reducing the space constraint on each group
add some structure by grouping options that the user might want to combine at the same time
add meaningful headers (might require the previous item). "special", "running options", "retrieval options" don't really convey any useful information.
make sure that only options that can be combines randomly are checkboxes (for example are "no info", "all info", "some info" really completely independent options? Same for "append to logfile", "overwrite logfile").
use appropriate controls (spinner for number entry, file selection dialog for files, radio buttons for mutually exclusive items, ...)
deactivate controls that make no sense with current configuration (for example custom directory text field).
move all actions to a single place
hide the scrollbars unless they are actually needed (i.e. reduce visual clutter)
be more consistent (why is it "running options" and "retrieval options" but not "special options"?)
One thing that you may have, but is obvious for the WGET example is the use of a main menu, e.g. File, Edit, Tools, Help. And also a button bar too?
First, define a hierarchy of control blocks. Even if everything must be visible, I think that some functions are more important than others. Also, make a clear separation between functions that apply to the domain (e.g., Start wGetStart.bat) and functions that apply to the software (e.g., Save settings).
Second, organize the layout according to this hierarchy: most essential to the top and to the left.
Third, let your design breathe. Space is fundamental for defining content.
Since no one has said this yet, I will: your window isn't really all that bad. Yes, it's ugly, and yes, I would be personally embarrassed to admit that I designed an interface that looks like that.
However, this window only produces a negative reaction the first few times you look at it. Once a user has used this form a couple of times, they will stop seeing it as a random collection of controls and instead start perceiving it as an interface that lets them see every piece of information that they require at a glance and that lets them do everything they need to do with a few mouse clicks.
It's a dialog for setting a bunch of options, and it's probably perfectly functional and not a big deal at all for your users. You could put a lot of work into some weird, fancy-schmantsy replacement UI that might impress the StackOverflow code-noscenti, but we don't pay your salary.
Now, the second window - that's a piece of crap.
Without knowing both the content your application and what it currently looks like, I can only guess at the problems you are facing, but here goes.
You say that this is being used by traders. While I have never dealt with that segment of the market I have often dealt with executives who need very specific information to run their businesses and the first cut of the application almost always looked like what you have displayed.
The original solution back in the day was to build a very light custom interface for each user of the application focusing on only the information relevant to that person. More recently the move has been toward making the interface customizable by the end user.
Chances are that none of your users are using all of the information presented to them. Each of them is using only a small subset. But each user is using a different subset. Try building the software so that each user can display only the information that they will be basing their decisions on.
Aside from other much-needed changed, adding a banner (displaying the company logo or something like that) seems to improve the overall appearance of the dialog.
I know it's a pure waste of space but it seems to improve the global feeling about the window.
alt text http://img24.imageshack.us/img24/3423/wget.jpg
Duplication - they might all have to be available instantly, but they could be available elsewhere as well. So you can have a keyboard accelerator, menu option, detachable panel, tabbed area ...
So this existing form could be the main, default interface (albeit improved with some of the other good design tips in other answers), but why not create an "expert" panel which can be a lot neater and try to work your users on to that, and away from this old "do everything" blotter.
I would really consider evaluating the usability goals of your project. Figure out what users want to do most frequently and most consistently with your application and default to that.
You should consider a wizard for this UI. Guide the user through a set of screens for the first use. And move many of these features as configurable options preferences.
Usability is not merely aesthetics IMHO. It is about making clear what the app is intending to do. I would refactor this app to provide shortcuts to common options patterns. If 90% of the time I am going to use a specific configuration of options why do I need to see every feature enumerated in the UI 100% of the time? It is just unnecessary clutter. Sensible defaults powerful configuration that is the goal. You don't have to sacrifice features, in a sense not making me think is a feature, perhaps the most important feature.
With respect to your specific app I would rework it with two basic screens a clean default screen and an advanced screen. Add the ability to create shortcuts to common configuration sets on the default screen. A simple button that maps to a specific configuration set and asks me for a url. And if the user needs to tweak an option present them with the advanced screen but treat it as preference configuration screen that saves the preference out to a shortcut button. If I want to use the configuration more than once let me save it as a custom bookmark or option on the defaults screen.
This is one of the things OS X does really well. There is a lot of power and customizability in OS X, "hidden features" if you will. But the OS defaults to sensible and straight forward options. Provide tools to the power users but don't clutter the system for the first time or casual user. This is not sacrificing functionality, it is effectively organizing functionality.
That is my first suggestion. But if absolutely don't want to hide options, I would make this a long scrollable vertical list organized in clear steps with explanation for each step:
Step 1: Provide URL ______________
Step 2: Configure Hosts _____________
Step 3: Configure Retrieval Options:
() option
() option
() option
() option
And so on...
At each step provide some context to the meaning of the configuration options.
The advantage to this is that you can clean up the UI aesthetically and provide useful configuration hints. I don't know what "Empty wGetStart.bat" means. I presume this empties a batch file of some sort. Provide me an explanation so that I know whether I want to click that button or not. And then let me hide explanations under a collapsible menu if I use the interface regularly.
My two cents.
This may not be appropriate, but...
Hide all the options in a stylesheet, much the way that all the paragraph formatting options are hidden in a word processor. Most of the time, the user just picks a named style. When the scary stuff is necessary, a click of an 'Advanced' button can grow the form to show all the options at a glance, to allow a few to be overridden, or to allow new named styles to be defined.
Obviously, a major advantage is that if there are a few particular configurations that are regularly used, it's trivial to switch between them and there's very little risk of accidentally setting one of the options wrong.
Another option - don't have all your options on display, use tabs or a wizard or whatever. Instead, have a text list of all options currently set (or all options in non-default states or whatever) to get the at-a-glance visibility.
These could be combined, so that your summary display says something like "like <style name>, except for ...", based on the style that's least different to the current options.
In a comment you say that a user "HAS to have all information available at once". Does that mean they have to see all the checkboxes and frames and scrollbars at once, or just the information?
For example, instead of having a multitude of checkboxes for option 1, option 2, option 3, etc, in the main GUI, only show the selected options and give the user a way to open a configuration window when they need to change something.
Instead of this:
+- Feature Set X - +
| |
| [x] option 1 |
| [x] option 2 |
| [ ] option 3 |
| [x] option 4 |
| |
+------------------+
show this:
feature set x: option 1, option 2, option 4 [configure...]
This lets the users see all the selected options without having to take up valuable real estate for all of the widgets necessary to change the values.
(apologies if the ascii art doesn't appear right -- it looks right in a fixed font :-\ )
An interesting article on this topic:
Managing UI Complexity by Brandon Walkin.
In the second example I would remove most of the arrows from the right hand side box. I would add the ability to click and drag to change the number(if your users are used to that I know several 3d packages that do it so it wouldn't be uncommon in relation to the example). You can change check boxes to buttons with backgrounds that change color or stay depressed when clicked as another option to reduce visual clutter.
In the right hand side box there are two or three separate functions mixed together that very well could get their own tab. When you are working with an object's color and texture you aren't going to be changing its size and view aspect ratio so having them right there means they are in the way. At the very list they need to be rearranged to be in some sort of logical order right now they are all over the place. Texture and color(things that effect color) should be together. Position rotation and view(things that effect shape\size) should be together.
It has already been said, but without seeing your application we can't give you a concrete answer on how to make your dialog less horrifying. If you can't post screenshots, then the best advice I can give is to hire a designer to help you work on the graphical end of your application; otherwise all you will get are general guidelines here.
Some things that might have not been discussed:
Think about the users of your applications and the systems that they run. I believe that most stock traders will have large dual monitor setups, so you can probably make your dialog larger and add space between your controls to make it look less cluttered. You should research your audience and see what they use.
Are you using the best controls for the job? In the first screenshot you posted I noticed a few controls that could be changed:
a. Under "Running Options" I see three checkbox options called All Info, No Info, Some Info. If only one can be selected at a time then maybe they could be changed into a drop down selection menu. Also under the same "Running Options" there is Append Logfile, Overwrite Logfile, which again you can convert to a drop down menu since you can select only one.
b. The two text fields where you can put in hosts, can probably be combined into one gridview with three columns. The first column is the host, the second is a checkbox for Accept, and the third is a checkbox for Reject.
By simply using different controls, we can still see everything we need but have less controls on the application.
Again, like I said above, witout seeing YOUR applications I can't really give you any specific suggestions.
Hope this helps.

Resources