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

chore: improve popover accessibility implementation #668

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

MicaelRodrigues
Copy link
Contributor

@MicaelRodrigues MicaelRodrigues commented Jul 12, 2023

This PR introduces some improvements to Popover implementation:

  • adds zIndex property with default to 1, so popover content isn't overflowed by subsequent elements.
  • included overflow: auto on container so user can scroll if content overflows.
  • included a11yId so content is better described for accessibility users.
  • adds popover toggle behaviour on enter if the user is using the keyboard to navigate and include basic focus style so user knows where he is while doing so.

JIRA Issue

Description 📄

[Enter the description of your changes]

Platforms 📲

  • Web
  • Mobile

Type of change 🔍

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? 🧪

[Enter the tips to test this PR]

  • Unit Test
  • Snapshot Test

Checklist: 🔍

  • My code follows the contribution guide of this project Contributing Guide
  • Layout matches design prototype: FIGMA
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots 📸

ZIndex

Before After
popover-before popover-after

Overflow: auto

Screenshot 2023-07-12 at 17 26 50

Enter key + focus

Screen.Recording.2023-07-12.at.17.29.00.mov

[Upload your screenshots here]

Before After

- add zIndex property with default to 1, so multiple popover don't
  overflow.
- include overflow: auto on container so user can scroll if content
  overflows.
- include a11yId so content is better described for accessibility users.
- add popover toggle behaviour on enter if the user is using the
  keyboard to navigate and include basic focus style so user knows where
  he is while doing so.
title: undefined,
position: 'bottom-center',
width: 265,
height: 116,
height: 200,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated this value to allow "text" content to grow at least until 200px which seems more reasonable (max-height). Please let me know if there is defined "rule"

Comment on lines +106 to +107
box-shadow: ${elevations.small};
transition: box-shadow ease 0.5s;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use our elevation box shadow, so a user navigating with keyboard can have a sense on the element being focused.

@MicaelRodrigues MicaelRodrigues changed the title chore: improve popover implementation chore: improve popover accessibility implementation Jul 12, 2023
@matheushdsbr matheushdsbr merged commit 8ffebaa into master Jul 13, 2023
3 checks passed
@matheushdsbr matheushdsbr deleted the bugfix/popover-z-index branch July 13, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants