Skip to content
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

Use <label>s rather than placeholders #356

Merged

Conversation

mpchadwick
Copy link
Contributor

Per #353 (comment) the solution proposed in #353 isn't really a great one. This approach simply swaps out the placeholders for <label>s. It would probably be a good idea to update this image if this feature is merged.

@jelmer
Copy link
Member

jelmer commented Nov 4, 2018

Can you provide some background on this, why are labels better than placeholders?

@jelmer
Copy link
Member

jelmer commented Jan 5, 2019

ping @mpchadwick

@mpchadwick
Copy link
Contributor Author

@jelmer I had outlined the reasoning here... #353 (comment)

Placeholders are is meant to be a hint (an example input) for the user about what to enter into the field, but shouldn't be used in lieu of a <label>. Per the links I included if using a placeholder they should be used something like this...

<label for="postbox__author">Name (optional)</label>
<input id="postbox__author" type="text" name="author" placeholder="John Smith" value="">

@mpchadwick
Copy link
Contributor Author

Placeholder as an alternative to a label:

HTML code example:

<input type="email" name="address" placeholder="address">

Placeholder text disappears when a text box receives focus:

  • For keyboard users this can be problematic as they must read ahead of current focus when filling in forms.
  • Users, especially those with memory impairments will not have the text label available for reference at the same time as filling in a field.

Source: https://developer.paciellogroup.com/blog/2011/02/html5-accessibility-chops-the-placeholder-attribute/

@jelmer jelmer merged commit 57af7a7 into isso-comments:master Jan 7, 2019
ix5 pushed a commit to ix5/isso that referenced this pull request May 5, 2022
Placeholders are is meant to be a hint (an example input)
for the user about what to enter into the field, but
shouldn't be used in lieu of a <label>.

See following links for further justification:
- https://www.tpgi.com/html5-accessibility-chops-the-placeholder-attribute/
- https://www.nngroup.com/articles/form-design-placeholders/
- https://www.maxability.co.in/2016/01/03/placeholder-attribute-and-why-it-is-not-accessible/

This commit is a reland of
isso-comments#356 with a fix for the
placeholder-replacement code in `isso.js` as reported in
isso-comments#524
ix5 pushed a commit to ix5/isso that referenced this pull request May 7, 2022
Placeholders are is meant to be a hint (an example input)
for the user about what to enter into the field, but
shouldn't be used in lieu of a <label>.

See following links for further justification:
- https://www.tpgi.com/html5-accessibility-chops-the-placeholder-attribute/
- https://www.nngroup.com/articles/form-design-placeholders/
- https://www.maxability.co.in/2016/01/03/placeholder-attribute-and-why-it-is-not-accessible/

This commit is a reland of
isso-comments#356 with a fix for the
placeholder-replacement code in `isso.js` as reported in
isso-comments#524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants