Skip to content

Commit

Permalink
[THES-154] BpkBottomSheet fix focus lock - accessibility (#3182)
Browse files Browse the repository at this point in the history
* THES-154 - BpkBottomSheet fix focus lock - accessibility

* THES-154 - BpkBottomSheetInner type fix

* THES-154 - BpkBottomSheetInner unit test fix

* THES-154 - BpkBottomSheetInner style fix

* THES-154 - BpkBottomSheetInner style fix REVERT

* THES-154 - BpkBottomSheetInner position fix

* THES-154 - BpkBottomSheetInner style build

* THES-154 - BpkBottomSheetInner readme

---------

Co-authored-by: Justyna Toporkiewicz <[email protected]>
  • Loading branch information
JToporkiewicz and Justyna Toporkiewicz authored Jan 22, 2024
1 parent b86f02b commit c87064b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/bpk-component-bottom-sheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ class App extends Component {
}
```

Ensure your body/children is accessible via Voice Over. You may need to specify the tabIndex of the elements.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('BpkBottomSheetInner', () => {
<BpkBottomSheetInner
id="my-bottom-sheet"
title="Bottom sheet title"
dialogRef={jest.fn()}
closeLabel="Close"
onClose={jest.fn()}
exiting={false}
Expand All @@ -42,6 +43,7 @@ describe('BpkBottomSheetInner', () => {
id="my-bottom-sheet"
title="Bottom sheet title"
closeLabel="Close"
dialogRef={jest.fn()}
onClose={jest.fn()}
wide
exiting={false}
Expand All @@ -57,6 +59,7 @@ describe('BpkBottomSheetInner', () => {
<BpkBottomSheetInner
id="my-bottom-sheet"
title="Bottom sheet title"
dialogRef={jest.fn()}
onClose={jest.fn()}
actionText="Dismiss"
onAction={jest.fn()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import type { ReactNode } from 'react';
export type Props = {
children: ReactNode;
closeLabel?: string;
dialogRef: (ref: HTMLElement | null | undefined) => void;
id: string;
onClose: () => void;
title?: string;
};
declare const BpkBottomSheetInner: ({ children, closeLabel, id, onClose, title, }: Props) => JSX.Element;
declare const BpkBottomSheetInner: ({ children, closeLabel, dialogRef, id, onClose, title, }: Props) => JSX.Element;
export default BpkBottomSheetInner;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ $close-button-width: bpk-spacing-lg() * 2;
@include bpk-border-radius-sm;

@include bpk-breakpoint-mobile {
position: fixed;
bottom: 0;
height: fit-content;
max-height: 90%;
margin-bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Props = {
actionText?: string;
children: ReactNode;
closeLabel?: string;
dialogRef: (ref: HTMLElement | null | undefined) => void;
id: string;
onAction?: () => void;
onClose: () => void;
Expand All @@ -46,6 +47,7 @@ const BpkBottomSheetInner = ({
actionText = '',
children,
closeLabel = '',
dialogRef,
exiting,
id,
onAction = () => null,
Expand Down Expand Up @@ -77,6 +79,7 @@ const BpkBottomSheetInner = ({
role="dialog"
aria-labelledby={headingId}
className={classNames}
ref={dialogRef}
>
<header className={getClassName('bpk-bottom-sheet--header')}>
<BpkNavigationBar
Expand Down

0 comments on commit c87064b

Please sign in to comment.