From 0977e2558cfb3b212e688539078e91a25a80c693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Ferr=C3=A3o?= Date: Wed, 30 Oct 2024 10:24:23 -0300 Subject: [PATCH 1/3] feat: add zIndex property --- react/Drawer.tsx | 5 ++++- react/Overlay.tsx | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/react/Drawer.tsx b/react/Drawer.tsx index f4bfe10..3502ed8 100644 --- a/react/Drawer.tsx +++ b/react/Drawer.tsx @@ -64,6 +64,7 @@ interface Props { customPixelEventId?: PixelData['id'] customPixelEventName?: PixelData['event'] onVisibilityChanged?: (visible: boolean) => void + zIndex?: number } function menuReducer(state: MenuState, action: MenuAction) { @@ -128,6 +129,7 @@ function Drawer(props: Props) { customPixelEventId, customPixelEventName, onVisibilityChanged, + zIndex = 999, } = props const handles = useCssHandles(CSS_HANDLES) const backdropMode = useResponsiveValue(backdropModeProp) @@ -203,7 +205,7 @@ function Drawer(props: Props) { )} - + }>
= ( - { visible, onClick }: Props, + { visible, onClick, zIndex = 999 }: Props, ref ) => { const handles = useCssHandles(CSS_HANDLES) @@ -23,6 +24,7 @@ const Overlay: RefForwardingComponent = ( style={{ opacity: visible ? 0.5 : 0, pointerEvents: visible ? 'auto' : 'none', + zIndex }} className={`${applyModifiers( handles.overlay, From 37f3e75db7c7740a61d3df63e435303e74bc5f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Ferr=C3=A3o?= Date: Wed, 30 Oct 2024 10:33:12 -0300 Subject: [PATCH 2/3] feat: fix lint error --- react/Drawer.tsx | 2 +- react/Overlay.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react/Drawer.tsx b/react/Drawer.tsx index 3502ed8..c328d6e 100644 --- a/react/Drawer.tsx +++ b/react/Drawer.tsx @@ -227,7 +227,7 @@ function Drawer(props: Props) { maxWidth, minWidth: 280, pointerEvents: isMenuOpen ? 'auto' : 'none', - zIndex + zIndex, }} >
= ( style={{ opacity: visible ? 0.5 : 0, pointerEvents: visible ? 'auto' : 'none', - zIndex + zIndex, }} className={`${applyModifiers( handles.overlay, From 97098881c875af204306256ec0042aaa9212d692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Ferr=C3=A3o?= Date: Wed, 30 Oct 2024 10:36:42 -0300 Subject: [PATCH 3/3] feat: update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0dfab..adee92b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Add `zIndex` as a property argument to control the drawer's z-index + ## [0.17.2] - 2024-08-13 ### Added