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

[client] js: Postbox: Use labels rather than placeholders #861

Merged
merged 6 commits into from
May 7, 2022

Conversation

ix5
Copy link
Member

@ix5 ix5 commented 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:

This commit is a reland of #356 with a fix for the placeholder-replacement code in isso.js as reported in #524


Also update snapshot and add a new test to avoid similar future errors.


Before:
Screenshot from 2022-05-05 15-04-33

After: (note Name, E-Mail, Website labels above input fields)

Screenshot from 2022-05-07 20-27-08

Mobile:
Screenshot from 2022-05-07 20-27-22


Previous revision (note Preview/Submit buttons vertically not aligned)
Screenshot from 2022-05-05 15-03-41


@ix5 ix5 added client (Javascript) client code and CSS improvement Not a new feature, but makes Isso more pleasant to use labels May 5, 2022
@ix5 ix5 added this to the 0.13 milestone May 5, 2022
mpchadwick and others added 5 commits May 7, 2022 19:55
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
Adding labels and changing the placeholders causes a change
in the generated HTML and necessitates an update of the
snapshot.
Should vanish when `require-author`/email is set in config.
The "Preview" and "Submit" buttons had
`display: inline-block` set, but this was ignored and reset
to `block` due to also being `float`-ed right.

The blocks would align at the same height as the labels, not
the height of the input fields. Because before the
introduction of the labels, the input fields and the submit
buttons aligned vertically, restore that state.

Set height of labels explicitly and offset the action
buttons by that same height vertically.

On mobile, where the post action buttons are on another row
below the input fields anyway, apply no top margin.
@ix5 ix5 force-pushed the js-template-labels-placeholders branch from 3980b1e to 0172c21 Compare May 7, 2022 18:24
@ix5
Copy link
Member Author

ix5 commented May 7, 2022

Future idea: Amend the email label to also inform users that the email collected will not be published and only be used for notifications/spam avoidance (but be saved in the Isso database).
Visual:
Screenshot from 2022-05-05 15-05-38

@ix5 ix5 merged commit b755d8a into isso-comments:master May 7, 2022
@ix5 ix5 deleted the js-template-labels-placeholders branch May 7, 2022 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client (Javascript) client code and CSS improvement Not a new feature, but makes Isso more pleasant to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants