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 State for Tabbable Elements #1963

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

dimak1
Copy link
Collaborator

@dimak1 dimak1 commented Jul 3, 2024

Issue #:

Description of changes:

  • Use :focus-visible pseudo class to apply outline styling only on Tab
  • Vue plugin to add event listeners for v-text-fields to fulfill the Tab-only requirement (no focus ring on mouse click)

Screenshot 2024-07-03 at 14 05 19

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the PPR license (Apache 2.0).

@dimak1 dimak1 added the a11y label Jul 3, 2024
@dimak1 dimak1 self-assigned this Jul 3, 2024
@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 3, 2024

@cameron-eyds just some context here. The requirement was to apply styling only when tabbing into the fields or buttons. The pseudo class :focus-visible is built specifically for it, and I was able to use it for buttons. However, for text input fields, it does not work - the :focus and :focus-visible are applied at the same time, so there is no way to differentiate it.

To solve this, I created a plugin that would add tab event listeners to all v-text-fields and style the fields on tab only. It could also be achieved via directive, but then we need to add it to all v-text-fields, which is more work.

Let me know if you have questions/comments. Thanks!

@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 3, 2024

/gcbrun

@bcregistry-sre
Copy link
Collaborator

Temporary Url for review: https://bcregistry-assets-dev--pr-1963-xvx3zta2.web.app

@cameron-eyds
Copy link
Collaborator

Code looks fine but some styling on the Registration Table Tabs is gone. The inactive tab would shrink slightly lower than the active tab. Maybe it's ok, would confirm with @LizGovier

Copy link
Collaborator

@cameron-eyds cameron-eyds left a comment

Choose a reason for hiding this comment

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

Code looks good but pending approval from @LizGovier with regards to the removal of the tab styling.

Edit* FWIW it's a very small thing and the tab designs for our MHR history don't include shrink/grow styling, so hopefully all good with design.

@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 3, 2024

@cameron-eyds thanks, tabs were tricky and bunch of styles needed to be updated in order for focus outline to show. I left some comments for Liz in the ticket, so we'll see.

Copy link
Collaborator

@doug-lovett doug-lovett left a comment

Choose a reason for hiding this comment

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

Looks great.

@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 4, 2024

/gcbrun

@bcregistry-sre
Copy link
Collaborator

Temporary Url for review: https://bcregistry-assets-dev--pr-1963-xvx3zta2.web.app

@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 4, 2024

/gcbrun

@bcregistry-sre
Copy link
Collaborator

Temporary Url for review: https://bcregistry-assets-dev--pr-1963-xvx3zta2.web.app

@dimak1
Copy link
Collaborator Author

dimak1 commented Jul 4, 2024

/gcbrun

@bcregistry-sre
Copy link
Collaborator

Temporary Url for review: https://bcregistry-assets-dev--pr-1963-xvx3zta2.web.app

@dimak1 dimak1 merged commit 5757de4 into bcgov:main Jul 5, 2024
4 of 5 checks passed
@dimak1 dimak1 deleted the feat/a11y-active-focus branch July 5, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants