Skip to content

Should title really be preferred over placeholder for the name? #168

@joanmarie

Description

@joanmarie
Contributor

I question why the title attribute is being preferred over the placeholder.

The scenario at hand is that we have an input which has no label element, and no aria-label value, and no aria-labelledby attribute and we have a title attribute and a placeholder attribute.

The placeholder value is likely to be shorter and what sighted user sees and uses to know what belongs in the input. That strikes me as a more name-like source.

The title value is not automatically going to be seen, unless the user hovers the mouse over the field. That strikes me as more secondary-level, non-essential information. There is also a chance that the title will be more wordy, which strikes me as a description; not a name.

Currently the title is a source for the accessible description. So if the placeholder is preferred over the title, and both attributes are present, the AT user who is blind will get a similar experience to that of the sighted user: Namely he/she will see the placeholder first, and that might be all that is needed to know what is expected in the field. But if more information is needed, it can be obtained through the screen reader either on demand, or after hearing the name, depending on their screen reader settings.

Note that we had some discussion about this during today's ARIA concall because we want AccName to be in sync with HTML-AAM and vice versa. The conclusion from our meeting is that I would open an issue for this discussion here (done). We do not yet have ARIA WG consensus on whether or not placeholder or title should be preferred. In other words, the question I raise is mine as an individual and NOT as the co-chair of the ARIA WG. :)

Activity

jnurthen

jnurthen commented on Feb 22, 2019

@jnurthen
Member

My opinion is that title should win over placeholder for backwards compatibility. There are plenty of sites which use both and currently get their accessible name from title. Placing placeholder above title in the algorithm would break all of these sites.

scottaohara

scottaohara commented on Feb 22, 2019

@scottaohara
Member

Hi @joanmarie. Here are my thoughts on this:

As there were previous efforts to remove placeholder in the accessible name computation, which implementors did not fully embrace, it seems counter to reintroduce placeholder in a higher placement in the algorithm than as a last resort.

While the input remained empty, a placeholder would provide a visible label (potentially poor color contrast aside), that would only be consistently exposed to all prior to user entry. The title, though only available on hover (or focus with Internet Explorer and Edge), would remain consistently available to the subset of people whom can access it via said manners.

Additionally, there is precedent in author guidance to use the title attribute as a means to provide an accessible name when a visible label cannot be used. e.g. WCAG technique H65.

Here's where @jnurthen's point comes in, as in situations where such guidance was followed, while also using a placeholder to appropriately provide a hint of expected entry, we'd get a less than ideal accessible name were title to come first. For example:

<input type="text" title="Name" placeholder="Jane Doe...">

Lastly, Mozilla made their intent clear in the bug they just worked on regarding this issue. Per Marco's comment:

...in Firefox, placeholder is the absolutely last resort for the name calc right now, after really everything else failed.

I hope this helps to clarify the ordering. More than happy to continue talking this out though :)

joanmarie

joanmarie commented on Feb 22, 2019

@joanmarie
ContributorAuthor

Ok, if everyone else thinks it's a better idea, I suppose I can live with it.

Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jnurthen@joanmarie@scottaohara

        Issue actions