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

Wrap the permission label with a <label> tag #1880

Merged
merged 1 commit into from May 24, 2018

Conversation

EdwardBetts
Copy link
Contributor

Gives the user a larger target to toggle a permission.

@tomhughes
Copy link
Member

Can you explain what you mean? How does that create a larger target exactly? What is the effect on the rendering of this change?

@EdwardBetts
Copy link
Contributor Author

Currently the user has to click the check box to toggle the option, with this change they can also click the label. The HTML changes to look like this:

<li><input type="checkbox" name="allow_read_prefs" id="allow_read_prefs" value="yes" checked="checked" /><label for="allow_read_prefs">read your user preferences.</label></li>

Gives the user a larger target to toggle a permission.
@tomhughes tomhughes merged commit 196ac7c into openstreetmap:master May 24, 2018
@EdwardBetts EdwardBetts deleted the patch-1 branch May 24, 2018 18:58
@gravitystorm
Copy link
Collaborator

Thanks @EdwardBetts ! This fixes a pet peeve of mine. There's lots more situations like this throughout the codebase, a simple search of app/views shows lots of label tags that aren't associated with any form fields. Even the ones that have "for" attributes are often wrong - e.g. app/views/user/new.html.erb where none of the label "for" attributes match the id of the form field. If you get the chance, fixing some of these, and moving them to rails tag helpers, would be appreciated too!

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.

None yet

3 participants