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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tabs] Fix Tabs accessibility issue #1869

Merged
merged 1 commit into from Jul 22, 2019
Merged

[Tabs] Fix Tabs accessibility issue #1869

merged 1 commit into from Jul 22, 2019

Conversation

dleroux
Copy link
Contributor

@dleroux dleroux commented Jul 22, 2019

WHY are these changes introduced?

Fixes #1577

WHAT is this pull request doing?

Our tabs generate an aria-control that points to tab panels that don't exist because only render the selected tab.

This generates all Panel and adds a display: none on the tabs that aren't selected.

How to 馃帺

To top hat, simply go to the Tab example in the playground and ensure that the value of the aria-controls prop of each tab (on buttons) matches the corresponding id of the panel content.

Copy-paste this code in playground/Playground.tsx:
import * as React from 'react';
import {Page} from '@shopify/polaris';

interface State {}

export default class Playground extends React.Component<never, State> {
  render() {
    return (
      <Page title="Playground">
        {/* Add the code you want to test here */}
      </Page>
    );
  }
}

馃帺 checklist

@BPScott BPScott temporarily deployed to polaris-react-pr-1869 July 22, 2019 16:30 Inactive
@BPScott BPScott temporarily deployed to polaris-react-pr-1869 July 22, 2019 16:34 Inactive
@dleroux dleroux changed the title [WIP] [Tabs] Fix Tabs accessibility issue [Tabs] Fix Tabs accessibility issue Jul 22, 2019
Copy link
Member

@chloerice chloerice left a comment

Choose a reason for hiding this comment

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

Each tab button's aria-controls now refers to an existent tab-panel's id 馃帀 馃殺 馃殺 馃殺

UNRELEASED.md Outdated Show resolved Hide resolved
src/components/Tabs/Tabs.scss Show resolved Hide resolved
@BPScott BPScott temporarily deployed to polaris-react-pr-1869 July 22, 2019 19:27 Inactive
Co-Authored-By: Chloe Rice <chloerice@users.noreply.github.com>

Co-Authored-By: Chloe Rice <chloerice@users.noreply.github.com>
@BPScott BPScott temporarily deployed to polaris-react-pr-1869 July 22, 2019 19:28 Inactive
@dleroux dleroux merged commit c4fcbc8 into master Jul 22, 2019
@alex-page alex-page temporarily deployed to production July 31, 2019 14:28 Inactive
@alex-page
Copy link
Member

@alex-page alex-page deleted the tab-a11y branch July 31, 2019 17:17
@tmlayton tmlayton temporarily deployed to patch August 12, 2019 20:21 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selecting a tab changes the Panel id causing missing aria-controls on Tab component
5 participants