Homec4science

Add support for placeholders

Authored by epriestley <git@epriestley.com> on Jul 31 2012, 01:08.

Description

Add support for placeholders

Summary:
Support placeholder text for inputs. We currently don't use this because it requires JS and doesn't degrade (no JS means you have zero idea what the input is for if it isn't separately labeled) but there are some cases where intent is obvious from context (for example, the search input in the menu bar, which is fairly obvious on its own and will soon have a magnifying glass icon) and in such cases it's much prettier and saves a bunch of space over an explicit label. Add a behavior so we can add placeholders where they make sense.

This implementation is somewhat sanity-checked agianst the two jQuery placeholder implementations I was able to google:

https://github.com/danielstocks/jQuery-Placeholder/
https://github.com/mathiasbynens/jquery-placeholder

Since we don't currently have any uses cases, I haven't included support for making JS access to the value work, for password inputs, or for dynamically altering the placeholder.

Test Plan: Played around with the placeholder in the UI example in various browsers and couldn't break it.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3103

Details

Committed
epriestley <git@epriestley.com>Jul 31 2012, 01:08
Pushed
aubortJan 31 2017, 17:16
Parents
rPHe7eac67cf388: Fix documentation on deprecated phd repository-launch-readonly
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHc8afc741fa7d: Add support for placeholders (authored by epriestley <git@epriestley.com>).Jul 31 2012, 01:08