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

Add focus-visible outline for checkboxes and radio buttons #24255

Merged
merged 3 commits into from
Feb 26, 2021

Conversation

PVince81
Copy link
Member

@PVince81 PVince81 commented Nov 20, 2020

To make keyboard navigation visible in forms.
When clicking with the mouse it doesn't appear (it's the magic of :focus-visible instead of :focus)

Ref https://www.w3.org/WAI/WCAG21/quickref/#focus-visible

This is how it looks like in this PR using the outline style and tabbing with the keyboard:

image

image

Without this it is almost impossible to find out what checkbox or radio button is currently focussed.

Tested with the settings pages and in the talk app.

@nextcloud/designers

@PVince81 PVince81 added bug design Design, UI, UX, etc. labels Nov 20, 2020
@PVince81 PVince81 added this to the Nextcloud 21 milestone Nov 20, 2020
@PVince81 PVince81 self-assigned this Nov 20, 2020
@PVince81
Copy link
Member Author

PVince81 commented Nov 20, 2020

need to test more locations

  • BUG: adjust outline offset for lonely checkboxes (file list):

image

  • TODO: action checkbox needs smaller outline offset (might need fixing in nextcloud-vue):

image

or remove outline completely there as we already have the left side blue indicator

@PVince81
Copy link
Member Author

adjusted files checkboxes specifically:
image

image

@PVince81
Copy link
Member Author

I wonder if we should also add such box around buttons, only for keyboard navigation.
Would you know which of these elements is currently focussed ?
image

(to be fixed separately)

@skjnldsv skjnldsv added the 2. developing Work in progress label Nov 23, 2020
@skjnldsv
Copy link
Member

Yes please!! ❤️
I think we can tune it a bit so it's a tad more pleasant (rounded borders, etc etc)

@PVince81
Copy link
Member Author

PVince81 commented Nov 23, 2020

seems we can't consistently add rounded borders to outlines: https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius

I don't want to make this a real border as it will mess up with the layout in many places

@skjnldsv
Copy link
Member

I don't want to make this a real border as it will mess up with the layout in many places

nonono, definitely! It needs to stay as floating as default html is! :)
If we can't at least improve the design a bit, let's leave it like that!

This was referenced Dec 14, 2020
@PVince81
Copy link
Member Author

I'm mostly worried about triggering additional work for every app developer related to checkboxes if we merge this.
Not sure if it's too late already or not to do so.

@skjnldsv
Copy link
Member

I'm mostly worried about triggering additional work for every app developer related to checkboxes

What extra work do you have in mind?
I think this will just dispatch and apply to all apps silently? No? Do we need to do anything else?

@PVince81
Copy link
Member Author

I predict that it won't always look good depending how checkboxes are used in apps, so tweaks by app devs will be needed.
In this PR I already had to tweak some of the file list parts
Also see how it affects the outline around the ActionCheckbox, which means we'll have to adjust that one as well.

This was referenced Dec 28, 2020
@rullzer rullzer modified the milestones: Nextcloud 21, Nextcloud 22 Jan 8, 2021
@PVince81 PVince81 force-pushed the bugfix/noid/missing-checkbox-focus branch from bbc5b64 to 3b62bfe Compare February 5, 2021 08:35
@PVince81
Copy link
Member Author

PVince81 commented Feb 5, 2021

since we're now at the beginning of 22 I think we could merge this.

it should leave enough time for app developers to adjust in case this causes visual glitches

@PVince81 PVince81 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 22, 2021
@PVince81 PVince81 force-pushed the bugfix/noid/missing-checkbox-focus branch from 3b62bfe to fab5eb4 Compare February 22, 2021 08:33
Copy link
Member

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

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

I think that the focus outline should be --color-main-text, at least that's what was decided for buttons.

To make keyboard navigation visible in forms.
When clicking with the mouse it doesn't appear.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
@PVince81 PVince81 force-pushed the bugfix/noid/missing-checkbox-focus branch from fab5eb4 to 49eff09 Compare February 26, 2021 09:23
@PVince81
Copy link
Member Author

with --color-main-text now:
image

@ma12-co

@PVince81 PVince81 merged commit 18b419f into master Feb 26, 2021
@PVince81 PVince81 deleted the bugfix/noid/missing-checkbox-focus branch February 26, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug design Design, UI, UX, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants