Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Update tabindex logic on main element #662

Merged
merged 3 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/terra-application-header-layout/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog

Unreleased
----------
# Removed
* Removed tabindex on main element to prevent keyboard page scroll bug

3.6.0 - (April 24, 2019)
------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ const ApplicationHeaderLayout = ({
const mainContainer = document.querySelector(['[data-terra-layout-main]']);

if (mainContainer) {
mainContainer.setAttribute('tabindex', '-1');
mainContainer.focus();
mainContainer.removeAttribute('tabindex');
}
};

Expand Down
3 changes: 3 additions & 0 deletions packages/terra-layout/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Unreleased
* Update react-router-dom peerDependency to latest stable major release
* Updated tabbable dependency to ^4.0.0

# Changed
* Update skip to content link handling to only temporary set tabindex to prevent keyboard page scroll bug

3.4.0 - (April 24, 2019)
------------------
### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-layout/src/_LayoutSlidePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class LayoutSlidePanel extends React.Component {
</div>
<OverlayContainer className={cx('content')}>
<Overlay isRelativeToContainer onRequestClose={onToggle} isOpen={isOverlayOpen} backgroundStyle={overlayBackground} zIndex="6000" />
<main data-terra-layout-main tabIndex="-1" className={cx('main-container')}>
<main data-terra-layout-main className={cx('main-container')}>
{children}
</main>
</OverlayContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exports[`LayoutSlidePanel should render when small 1`] = `
<main
className="main-container"
data-terra-layout-main={true}
tabIndex="-1"
>
<div>
Child
Expand Down Expand Up @@ -66,7 +65,6 @@ exports[`LayoutSlidePanel should render when tiny 1`] = `
<main
className="main-container"
data-terra-layout-main={true}
tabIndex="-1"
>
<div>
Child
Expand Down Expand Up @@ -104,7 +102,6 @@ exports[`LayoutSlidePanel should render with provided props 1`] = `
<main
className="main-container"
data-terra-layout-main={true}
tabIndex="-1"
>
<div>
Child
Expand Down Expand Up @@ -137,7 +134,6 @@ exports[`LayoutSlidePanel should render without optional props 1`] = `
<main
className="main-container"
data-terra-layout-main={true}
tabIndex="-1"
/>
</OverlayContainer>
</div>
Expand Down