From 00629a0fb86d3b8f7f1a39a88dfae6b936051b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toprak=20Ko=C3=A7?= Date: Fri, 10 Nov 2023 15:12:07 +0300 Subject: [PATCH] Fix - #5271 sidebar fullscreen unnecessary class assignments fix (#5272) * updated fullscreen class assignments and removed unused func * lint * removed unnecessary importants --- components/lib/sidebar/Sidebar.js | 7 ------- components/lib/sidebar/SidebarBase.js | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/components/lib/sidebar/Sidebar.js b/components/lib/sidebar/Sidebar.js index d023fe1d93..9faee8bd95 100644 --- a/components/lib/sidebar/Sidebar.js +++ b/components/lib/sidebar/Sidebar.js @@ -53,13 +53,6 @@ export const Sidebar = React.forwardRef((inProps, ref) => { return sidebarRef && sidebarRef.current && !sidebarRef.current.contains(event.target); }; - const getPositionClass = () => { - const positions = ['left', 'right', 'top', 'bottom']; - const pos = positions.find((item) => item === props.position); - - return pos ? `p-sidebar-${pos}` : ''; - }; - const focus = () => { const activeElement = document.activeElement; const isActiveElementInDialog = activeElement && sidebarRef && sidebarRef.current.contains(activeElement); diff --git a/components/lib/sidebar/SidebarBase.js b/components/lib/sidebar/SidebarBase.js index 008b034e1c..ee62578c75 100644 --- a/components/lib/sidebar/SidebarBase.js +++ b/components/lib/sidebar/SidebarBase.js @@ -11,7 +11,7 @@ const classes = { return classNames( 'p-sidebar-mask', - pos ? `p-sidebar-${pos}` : '', + pos && !props.fullScreen ? `p-sidebar-${pos}` : '', { 'p-component-overlay p-component-overlay-enter': props.modal, 'p-sidebar-mask-scrollblocker': props.blockScroll, @@ -94,11 +94,11 @@ const styles = ` .p-sidebar-full .p-sidebar { transition: none; transform: none; - width: 100vw !important; - height: 100vh !important; + width: 100vw; + height: 100vh; max-height: 100%; - top: 0px !important; - left: 0px !important; + top: 0px; + left: 0px; } /* Animation */