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

Increase clickable area for inline checkboxes #281

Open
brynwhyman opened this issue Jan 15, 2019 · 4 comments
Open

Increase clickable area for inline checkboxes #281

brynwhyman opened this issue Jan 15, 2019 · 4 comments

Comments

@brynwhyman
Copy link

I think it makes sense to update the styling so the whole cell/padding for column's inline editable checkbox is selectable.

Things to consider when doing this:

  • We may need to add a label for the checkbox in order to make it clickable
  • The label needs to be accessible and not confuse screenreaders
  • The checkbox identifies the column header as its label at the moment, we'd need to change that to the label
@brynwhyman
Copy link
Author

Originally raised in: silverstripe/silverstripe-ckan-registry#101

From @ScopeyNZ:

I agree it belongs on GridFieldExtensions. I think there should be a variant (probably through configuration) that allows label-less checkboxes in columns. It can still be screen reader friendly with appropriate html attributes. I personally would prefer that it also involve making the whole table cell the label for the checkbox - ie. making a click anywhere on the cell toggle the checkbox.

@robbieaverill
Copy link
Contributor

cc @nglasl @nyeholt how do you feel about this change?

@nglasl
Copy link
Contributor

nglasl commented Jan 17, 2019

@robbieaverill this change sounds good to me. I've used checkboxes in cells previously, and they've always been much nicer to use when the entire cell was clickable. It's also possible to capture this click event in the cell and toggle the checkbox based on that using JS (assuming we can target it reliably); I can't foresee any accessibility issues with that approach since it should remain how it is now for the most part (e.g. keyboard accessible and no label changes). Thoughts?

@robbieaverill
Copy link
Contributor

Yeah sounds good. So it's probably worth checking whether we need to add a label to go with the checkbox for screenreaders - if so, update the styles etc so the label takes up the whole column. If not, we could do as @nglasl suggested and use a JS click handler on the table cell to trigger a change on the checkbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants