Skip to content

Commit

Permalink
Fix - #5271 sidebar fullscreen unnecessary class assignments fix (#5272)
Browse files Browse the repository at this point in the history
* updated fullscreen class assignments and removed unused func

* lint

* removed unnecessary importants
  • Loading branch information
nitrogenous authored Nov 10, 2023
1 parent 765d030 commit 00629a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
7 changes: 0 additions & 7 deletions components/lib/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions components/lib/sidebar/SidebarBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 00629a0

Please sign in to comment.