Merge pull request #5140 from thornbill/fix-backdrop-position
This commit is contained in:
commit
0c3793e59a
2 changed files with 12 additions and 6 deletions
|
@ -1,7 +1,15 @@
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
|
import layoutManager from './layoutManager';
|
||||||
import { DRAWER_WIDTH } from './ResponsiveDrawer';
|
import { DRAWER_WIDTH } from './ResponsiveDrawer';
|
||||||
|
|
||||||
|
const styles = layoutManager.experimental ? {
|
||||||
|
left: {
|
||||||
|
md: DRAWER_WIDTH
|
||||||
|
}
|
||||||
|
} : {};
|
||||||
|
|
||||||
const Backdrop = () => {
|
const Backdrop = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Initialize the UI components after first render
|
// Initialize the UI components after first render
|
||||||
|
@ -12,11 +20,7 @@ const Backdrop = () => {
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
className='backdropContainer'
|
className='backdropContainer'
|
||||||
sx={{
|
sx={styles}
|
||||||
left: {
|
|
||||||
md: DRAWER_WIDTH
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<div className='backgroundContainer' />
|
<div className='backgroundContainer' />
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -18,6 +18,7 @@ class LayoutManager {
|
||||||
tv = false;
|
tv = false;
|
||||||
mobile = false;
|
mobile = false;
|
||||||
desktop = false;
|
desktop = false;
|
||||||
|
experimental = false;
|
||||||
|
|
||||||
setLayout(layout, save) {
|
setLayout(layout, save) {
|
||||||
if (!layout || layout === 'auto') {
|
if (!layout || layout === 'auto') {
|
||||||
|
@ -31,7 +32,8 @@ class LayoutManager {
|
||||||
setLayout(this, 'tv', layout);
|
setLayout(this, 'tv', layout);
|
||||||
setLayout(this, 'desktop', layout);
|
setLayout(this, 'desktop', layout);
|
||||||
|
|
||||||
if (layout === 'experimental') {
|
this.experimental = layout === 'experimental';
|
||||||
|
if (this.experimental) {
|
||||||
const legacyLayoutMode = browser.mobile ? 'mobile' : this.defaultLayout || 'desktop';
|
const legacyLayoutMode = browser.mobile ? 'mobile' : this.defaultLayout || 'desktop';
|
||||||
setLayout(this, legacyLayoutMode, legacyLayoutMode);
|
setLayout(this, legacyLayoutMode, legacyLayoutMode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue