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

Make radio and checkbox labels inline blocks #634

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Apr 6, 2018

Make radio and checkbox inline blocks so that the effective click area only extends to the label. Without this change, the labels extend to the full width of the container which means the clicks apparently in space on the right hand side activate the inputs.

Before

before

After

after

Testing

Tested in:

  • Internet Explorer 8
  • Internet Explorer 9
  • Internet Explorer 10
  • Internet Explorer 11
  • Edge 16
  • Google Chrome 65 (Mac)
  • Mozilla Firefox 59 (Mac)
  • Safari 11 (Mac)
  • Internet Explorer, Windows Phone 8.1
  • Safari, iOS 9 (Simulated, iPhone 6S)
  • Safari, iOS 11.3 (Physical, iPhone X)
  • Android Google Chrome (Simulated, Samsung Galaxy S8)
  • Samsung Internet (Simulated, Samsung Galaxy S8)

Fixes #543

Make radio and checkbox inline blocks so that the effective click area only extends to the label. Without this change, the labels extend to the full width of the container which means the clicks apparently in space on the right hand side activate the inputs.

Fixes #543
@NickColley
Copy link
Contributor

NickColley commented Apr 6, 2018

This looks good, but I'm questioning if this is actually a bug.

One argument is that the before would make it easier to click an option on a mobile device?

@36degrees
Copy link
Contributor Author

Fair comment… this might be one for @dashouse @timpaul or @joelanman?

I thought there might be issues with accidentally triggering whilst scrolling but from testing at least on iPhone this doesn't seem to be an issue.

One consideration is if we implement hover states for radio buttons and checkboxes then moving the mouse down the right hand side of the screen would trigger the hover state, which may be distracting for some users.

@joelanman
Copy link
Contributor

I think on larger screen sizes its definitely a bug - you can trigger a radio button with a seemingly unrelated click. Also it's not how Elements works, so it's a change we'd need to do consciously.

On smaller screens it could possibly be ok, but I wonder if it's worth adding the complexity of it being different at different screen sizes for something that may or may not be helpful. I'd say no.

In user research the large majority of people try to click/tap the circle, which is why we made it really big.

@NickColley
Copy link
Contributor

Ship it

@36degrees
Copy link
Contributor Author

@NickColley if you're happy with this can you approve it?

Copy link

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@36degrees 36degrees merged commit aaaf7b0 into master Apr 9, 2018
@36degrees 36degrees deleted the radios-checkboxes-inline-block branch April 9, 2018 09:27
kr8n3r pushed a commit that referenced this pull request Jun 22, 2018
kr8n3r pushed a commit that referenced this pull request Jun 26, 2018
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.

5 participants