diff --git a/packages/react-core/src/components/Drawer/Drawer.tsx b/packages/react-core/src/components/Drawer/Drawer.tsx index 8cfcdbf233f..128249990f6 100644 --- a/packages/react-core/src/components/Drawer/Drawer.tsx +++ b/packages/react-core/src/components/Drawer/Drawer.tsx @@ -19,10 +19,12 @@ export interface DrawerProps extends React.HTMLProps { export interface DrawerContextProps { isExpanded: boolean; + isStatic: boolean; } export const DrawerContext = React.createContext>({ - isExpanded: false + isExpanded: false, + isStatic: false }); export const Drawer: React.SFC = ({ @@ -34,7 +36,7 @@ export const Drawer: React.SFC = ({ position = 'right', ...props }: DrawerProps) => ( - +
= ({ ...props }: DrawerPanelContentProps) => ( - {({ isExpanded }) => ( + {({ isExpanded, isStatic }) => (
= ({ widthOn2Xl && styles.modifiers[`width_${widthOn2Xl}On_2xl` as keyof typeof styles.modifiers], className )} - hidden={!isExpanded} - aria-hidden={!isExpanded} - aria-expanded={isExpanded} + hidden={isStatic ? false : !isExpanded} {...props} > {children} diff --git a/packages/react-core/src/components/Drawer/__tests__/Generated/DrawerPanelContent.test.tsx b/packages/react-core/src/components/Drawer/__tests__/Generated/DrawerPanelContent.test.tsx index 84e423f9957..02de8ef65f7 100644 --- a/packages/react-core/src/components/Drawer/__tests__/Generated/DrawerPanelContent.test.tsx +++ b/packages/react-core/src/components/Drawer/__tests__/Generated/DrawerPanelContent.test.tsx @@ -8,6 +8,6 @@ import { DrawerPanelContent } from '../../DrawerPanelContent'; import {} from '../..'; it('DrawerPanelContent should match snapshot (auto-generated)', () => { - const view = shallow(ReactNode
} noPadding={false} />); + const view = shallow(ReactNode
} />); expect(view).toMatchSnapshot(); }); diff --git a/packages/react-core/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap b/packages/react-core/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap index ab2f9badd87..a57c32e2ffe 100644 --- a/packages/react-core/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap +++ b/packages/react-core/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap @@ -5,6 +5,7 @@ exports[`Drawer should match snapshot (auto-generated) 1`] = ` value={ Object { "isExpanded": false, + "isStatic": false, } } > diff --git a/packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap b/packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap index 329777a1cb3..66db99eb9e1 100644 --- a/packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap +++ b/packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap @@ -41,8 +41,6 @@ exports[`Drawer isExpanded = false and isInline = false and isStatic = false 1`]