question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modal, Vanilla: AVT 2 issue: Keyboard users can't scroll static content when it overflows

See original GitHub issue

Environment

Operating system

Mac

Browser

All

Automated testing tool and ruleset

n/a

Assistive technology used to verify

Keyboard

Detailed description

What version of the Carbon Design System are you using?

v10.3.2

What did you expect to happen?

I would be able to focus the content container so that I could use my arrow keys to scroll the content

What happened instead?

I was not able to focus the container that had overflowing content so I was not able to read it

What WCAG 2.1 checkpoint does the issue violate?

https://www.ibm.com/able/guidelines/ci162/keyboard.html

Steps to reproduce the issue

Using only a keyboard

  1. navigate within a modal that has overflowing content
  2. notice you can never focus the content, making it so you can’t scroll it unless you are using a mouse

Please create a reduced test case in CodeSandbox

Includes the HTML fix: https://codesandbox.io/embed/modal-overflow-content-srskh

Additional information

  • Need to add tabindex=0 to the content container so that it is focusable. This should be done only when the content overflows for the best experiences (dynamically via JS).
  • Need input from @carbon-design-system/design around what the focus style for the content container should be

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
elizabethsjuddcommented, Aug 2, 2019

@dakahn this is the styling (which were just merged in to master) that was approved for design: https://github.com/carbon-design-system/carbon/issues/3261#issuecomment-507864039 and having it always on just means that if you are tabbing within a modal, you will always be able to highlight the content even if it’s not scrollable.

1reaction
elizabethsjuddcommented, Jul 9, 2019

@carbon-design-system/developers if you want to assign this to me I can take a look at it in the next couple of weeks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixed modal wont scroll when overflowing the viewport
The modal has content whose height may end up larger than the viewport and thus needs to scroll, but its just not working....
Read more >
Well-controlled scrolling with CSS Scroll Snap - web.dev
Here scroll snapping ensures at the end of scrolling an image horizontal center is aligned with the horizontal center of the scroll container....
Read more >
Modal | Bulma
A classic modal overlay, in which you can include any content you want ... modifier to a containing element (usually html ) to...
Read more >
Dialog Focus in Screen Readers - Adrian Roselli
The content area has tabindex="0" because the content can scroll and this allows a keyboard-only user to scroll it. My test suite on...
Read more >
Prevent Page Scrolling When a Modal is Open | CSS-Tricks
Unfortunately overscroll-behavior: contain does not prevent the scrolling when the content is less or equal to the parent(as in, no overflow).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found