CSS icon button half going offscreen on mobile view - css

I was able to make it so that the search bar stays to the right of the search bar. Not mandatory of course. I can be inside the right side of the search bar. This is the gitHub link for this: https://github.com/strawberries73/telescope/tree/Issue-1226
What I did try was an InputAdornment method. https://material-ui.com/components/text-fields/#input-adornments. This code can be found here: https://github.com/strawberries73/telescope/tree/Issue-1225
import React from 'react';
import { makeStyles } from '#material-ui/core/styles';
import PropTypes from 'prop-types';
import SearchIcon from '#material-ui/icons/Search';
import {
Grid,
MenuItem,
TextField,
FormControl,
Paper,
IconButton,
Box,
Typography,
Fab,
} from '#material-ui/core';
const useStyles = makeStyles((theme) => ({
root: {
overflow: 'visible',
maxWidth: '785px',
padding: 0,
marginTop: '10rem',
marginLeft: 'auto',
marginRight: 'auto',
},
card: {
padding: theme.spacing(2, 4, 2, 4),
backgroundColor: theme.palette.background.default,
},
input: {
fontSize: '1.6rem',
'& > *': {
fontSize: '1.6rem !important',
color: theme.palette.text.default,
},
},
header: {
padding: 0,
marginBottom: theme.spacing(2),
backgroundColor: theme.palette.primary.main,
},
h1: {
display: 'block',
transition: 'all linear 350ms',
fontWeight: 600,
color: theme.palette.text.secondary,
[theme.breakpoints.between('xs', 'sm')]: {
fontSize: '3rem',
},
[theme.breakpoints.between('md', 'lg')]: {
fontSize: '4rem',
},
[theme.breakpoints.up('xl')]: {
fontSize: '5rem',
},
},
iconButton: {
backgroundColor: theme.palette.secondary.main,
'&:hover': {
backgroundColor: theme.palette.secondary.dark,
},
'& * > .MuiSvgIcon-root': {
fontSize: '2rem',
color: theme.palette.text.primary,
},
margin: 0,
marginRight: theme.spacing(-1.45),
bottom: theme.spacing(-2),
float: 'right',
marginBottom: theme.spacing(-5.5),
[theme.breakpoints.only('xs')]: {
marginTop: theme.spacing(6),
marginRight: theme.spacing(-8),
},
},
selectControl: {
'& > *': {
fontSize: '1.2rem',
textTransform: 'capitalize',
color: theme.palette.primary.main,
},
},
selectItem: {
fontSize: '1.4rem',
textTransform: 'capitalize',
color: theme.palette.primary.main,
},
}));
function CustomizedInputBase(props) {
const classes = useStyles();
const { searchText, onChangeHandler, onFilterChangeHandler, filter, onFormSubmit } = props;
const onFilterChange = (event) => {
onFilterChangeHandler(event.target.value);
};
const onTextChange = (event) => {
onChangeHandler(event.target.value);
};
const onSubmit = (event) => {
event.preventDefault();
onFormSubmit();
};
const searchOptions = ['post', 'author'];
return (
<Box className={classes.root} boxShadow={2}>
<Paper component="form" className={classes.card} elevation={0}>
<Grid
container
className={classes.header}
direction="row"
spacing={8}
alignItems="center"
justify="flex-start"
>
<Grid item xs={12}>
<Typography variant="h1" className={classes.h1}>
Search
</Typography>
</Grid>
</Grid>
<Fab size="large" className={classes.iconButton}>
<FormControl>
<IconButton type="submit" onClick={(event) => onSubmit(event)} aria-label="search">
<SearchIcon />
</IconButton>
</FormControl>
</Fab>
<Grid container direction="row" spacing={2} alignItems="center" justify="flex-start">
<Grid item xs={12} sm={2} lg={2}>
<FormControl fullWidth={true}>
<TextField
id="standard-select-search-type"
select
label="Filter"
value={filter}
variant="outlined"
className={classes.selectControl}
onChange={(event) => onFilterChange(event)}
>
{searchOptions.map((option) => (
<MenuItem key={option} value={option} className={classes.selectItem}>
{option}
</MenuItem>
))}
</TextField>
</FormControl>
</Grid>
<Grid item xs={12} sm={10} lg={10}>
<FormControl fullWidth={true}>
<TextField
className={classes.input}
placeholder="How to Get Started in Open Source"
inputProps={{ 'aria-label': 'search telescope' }}
variant="outlined"
value={searchText}
onChange={(event) => onTextChange(event)}
/>
</FormControl>
</Grid>
</Grid>
</Paper>
</Box>
);
}
CustomizedInputBase.propTypes = {
searchText: PropTypes.string,
onChangeHandler: PropTypes.func,
onFilterChangeHandler: PropTypes.func,
onFormSubmit: PropTypes.func,
filter: PropTypes.string,
};
export default CustomizedInputBase;

Solved! My solution to my answer.
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '#material-ui/core/styles';
import SearchIcon from '#material-ui/icons/Search';
import InputAdornment from '#material-ui/core/InputAdornment';
import {
Grid,
MenuItem,
TextField,
FormControl,
Paper,
IconButton,
Box,
Typography,
} from '#material-ui/core';
import SearchHelp from '../SearchHelp';
const useStyles = makeStyles((theme) => ({
root: {
overflow: 'visible',
maxWidth: '785px',
padding: 0,
marginTop: '10rem',
marginLeft: 'auto',
marginRight: 'auto',
marginBottom: theme.spacing(6),
},
card: {
padding: theme.spacing(2, 4, 2, 4),
backgroundColor: theme.palette.background.default,
},
header: {
padding: 0,
marginBottom: theme.spacing(2),
backgroundColor: theme.palette.primary.main,
},
h1: {
display: 'block',
transition: 'all linear 350ms',
fontWeight: 600,
color: theme.palette.text.secondary,
[theme.breakpoints.between('xs', 'sm')]: {
fontSize: '3rem',
},
[theme.breakpoints.between('md', 'lg')]: {
fontSize: '4rem',
},
[theme.breakpoints.up('xl')]: {
fontSize: '5rem',
},
},
iconButton: {
backgroundColor: theme.palette.secondary.main,
'&:hover': {
backgroundColor: theme.palette.secondary.dark,
},
'& * > .MuiSvgIcon-root': {
fontSize: '2rem',
color: theme.palette.primary.contrastText,
},
margin: 0,
position: 'relative',
bottom: theme.spacing(6),
float: 'right',
marginBottom: theme.spacing(-12),
},
selectControl: {
'& > *': {
fontSize: '1.2rem',
textTransform: 'capitalize',
color: theme.palette.primary.main,
},
},
selectItem: {
fontSize: '1.4rem',
textTransform: 'capitalize',
color: theme.palette.primary.main,
},
}));
function CustomizedInputBase(props) {
const classes = useStyles();
const { text, onTextChange, onFilterChange, filter, onSubmit } = props;
const searchOptions = ['post', 'author'];
return (
<Box className={classes.root} boxShadow={2}>
<Paper component="form" className={classes.card} elevation={0}>
<Grid
container
className={classes.header}
direction="row"
spacing={8}
alignItems="center"
justify="flex-start"
>
<Grid item>
<Typography variant="h1" className={classes.h1}>
Search
</Typography>
</Grid>
<SearchHelp />
</Grid>
<Grid container direction="row" spacing={2} alignItems="center" justify="flex-start">
<Grid item xs={12} sm={2} lg={2}>
<FormControl fullWidth={true}>
<TextField
id="standard-select-search-type"
select
label="Filter"
value={filter}
variant="outlined"
className={classes.selectControl}
onChange={(event) => onFilterChange(event.target.value)}
>
{searchOptions.map((option) => (
<MenuItem key={option} value={option} className={classes.selectItem}>
{option}
</MenuItem>
))}
</TextField>
</FormControl>
</Grid>
<Grid item xs={12} sm={10} lg={10}>
<FormControl fullWidth={true}>
<TextField
className={classes.input}
placeholder="How to Get Started in Open Source"
inputProps={{ 'aria-label': 'search telescope' }}
variant="outlined"
value={text}
InputProps={{
endAdornment: (
<InputAdornment>
<IconButton type="submit" className={classes.iconButton} onClick={onSubmit}>
<SearchIcon />
</IconButton>
</InputAdornment>
),
}}
onChange={(event) => onTextChange(event.target.value)}
/>
</FormControl>
</Grid>
</Grid>
</Paper>
</Box>
);
}
CustomizedInputBase.propTypes = {
text: PropTypes.string,
onTextChange: PropTypes.func,
filter: PropTypes.string,
onFilterChange: PropTypes.func,
onSubmit: PropTypes.func,
};
export default CustomizedInputBase;

Related

MUI 5 Tab Label Custom Thickness

I need to change the thickness of label inside a tab using MUI 5.
Here are what I tried:
interface TabPanelProps {
children?: React.ReactNode;
index: number;
value: number;
}
function TabPanel(props: TabPanelProps) {
const { children, value, index, ...other } = props;
return (
<div
role="tabpanel"
hidden={value !== index}
id={`simple-tabpanel-${index}`}
aria-labelledby={`simple-tab-${index}`}
{...other}
>
{value === index && (
<Box sx={{ p: 3 }}>
<Typography>{children}</Typography>
</Box>
)}
</div>
);
}
function a11yProps(index: number) {
return {
id: `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,
};
}
export default function UsersGroupsManagement() {
const [value, setValue] = React.useState(0);
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
};
const StyledTab = styled(Tab)<TabProps>(({theme}) => ({
'& .MuiButtonBase-root-MuiTab-root': {
fontWeight: 'bold'
}
}));
const styledLabel = styled('label')({
color: 'darkslategray',
backgroundColor: 'aliceblue',
padding: 8,
borderRadius: 4,
});
return (
<Box sx={styles.userAccounts}>
<Box sx={styles.tabbox}>
<Tabs value={value} onChange={handleChange} aria-label="User Management Tabs" >
<Tab label="ADD NEW USER" {...a11yProps(0)} sx={{
'& .MuiButtonBase-root-MuiTab-root': {
color: 'black',
backgroundColor: 'red',
fontWeight: 'bold'
}
}}/>
<Tab label="MANAGE USERS" {...a11yProps(1)} sx={{
'& .MuiButtonBase-root-MuiTab-root': {
fontWeight: 'bold'
}
}}/>
</Tabs>
</Box>
<TabPanel value={value} index={0}>
<AddNewUser />
</TabPanel>
<TabPanel value={value} index={1}>
Item Two
</TabPanel>
</Box>
);
}
I tried to create a StyledTab but didnt work.
I tried to create a styled label didnt work at all.
I tried to give css from sx props using but didnt work.
Can you please explain me how can I manage to make thicker labeled tabs in Material UI v5?
u can follow something like this..
<Tabs
sx={{
"& .MuiTabs-indicator": { backgroundColor: "#E86826" },
"& .MuiTab-root.Mui-selected": { color: "#E86826", fontWeight:"700" },
}}
value={value}
onChange={handleChange}
aria-label="nav tabs example"
centered
>
Just Edit the tabs and u work is done...hope it helps

Reactjs / Material-UI: className does not work on the ToggleButton component [duplicate]

This question already has an answer here:
Use calc() function in makeStyles
(1 answer)
Closed 1 year ago.
Using React / Material UI, I am trying to apply styles to a group of ToggleButtons .
Currently I can only define the style prop for each ToggleButton to make it work.
I am trying to do className={...} instead, to make the code better.
However, I found that this does not work for ToggleButton components:
import ToggleButton from '#mui/material/ToggleButton';
import ToggleButtonGroup from '#mui/material/ToggleButtonGroup';
import useStyles from './styles';
const DashboardSettings = () = {
const classes = useStyles();
return (
<Fragment>
<Paper className={classes.paper} elevation={10}> // here works
<Typography variant="h4" gutterBottom>
Settings
</Typography>
<br />
<br />
<Grid spacing={3} container>
<Grid xs={12} item>
<Grid container>
<Grid item xs={12}>
<p>Holiday(s): </p>
</Grid>
<Grid item xs={1}></Grid>
<Grid item xs={10}>
<ToggleButtonGroup
// value={formats}
onChange={() => {}}
// fullWidth
aria-label="text formatting"
mt={10}
>
<ToggleButton value="mon" className={classes.toggleButton}> // here it has no effect!
<p>Monday</p>
</ToggleButton>
<ToggleButton value="mon" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Monday</p>
</ToggleButton>
<ToggleButton value="tue" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Tuesday</p>
</ToggleButton>
<ToggleButton value="wed" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Wednesday</p>
</ToggleButton>
<ToggleButton value="thu" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Thursday</p>
</ToggleButton>
<ToggleButton value="fri" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Friday</p>
</ToggleButton>
<ToggleButton value="sat" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Saturday</p>
</ToggleButton>
<ToggleButton value="sun" style={{marginRight: "5px", marginLeft: "5px", backgroundColor: "#FCDC00"}}>
<p>Sunday</p>
</ToggleButton>
</ToggleButtonGroup>
</Grid>
<Grid item xs={1}></Grid>
</Grid>
</Grid>
)
}
./styles.js:
import { makeStyles } from '#material-ui/core';
const useStyles = makeStyles((theme) => ({
paper: {
marginTop: theme.spacing(3),
marginBottom: theme.spacing(3),
padding: theme.spacing(20),
[theme.breakpoints.up(600 + theme.spacing(3) * 2)]: {
marginTop: theme.spacing(6),
marginBottom: theme.spacing(6),
padding: theme.spacing(3),
},
},
toggleButton: {
marginRight: "5px",
marginLeft: "5px",
color: "#000000",
backgroundColor: "#FFFFFF"
},
}));
export default useStyles;
Why does it not work?
here is a view of it:
How can I apply styles to these buttons in a neater way then?
these components are not dom(document object model) elements. instead, they are a wrapper around the dom-elements and they pass some of the values to element attributes through props. so if props aren't.
Also it might be the case that when you provide styles through className in that scenarios style directly provided to element have more specificity than you class-Styles. it's better to use decorators like !important.
ex.
height: '120px !important',
export const ToggleButton = (props) => {
//you can only pass those props which is being used here.
// here i am using className as props and further i have passed to original elements.
// in your case there is no className attribute.
const {onClick, style, className, children, text, type} = props;
return (
<button onClick={onClick} style={style} className={className} type={type}>
{children || text}
</button>
)
}
available then you can't pass that to the component as there is no implementation for the same.

the drawer covers the page

my drawer is covering the page i want it to be flex to the left without covering any content. this is my first time using material-ui so if anyone can explain i would appreciate that
const drawerWidth = 240;
const SideBar = (props) => {
const useStyles = makeStyles((theme) => ({
root: { display: "flex" },
}));
const classes = useStyles();
return (
<div>
<Drawer
sx={{
width: drawerWidth,
flexShrink: 0,
"& .MuiDrawer-paper": {
width: drawerWidth,
boxSizing: "border-box",
},
}}
variant="permanent"
anchor="left"
>
<Toolbar />
<List>
<Divider />
{props.jobs.map((job, i) => (
<ListItem
alignItems="flex-start"
key={i}
onClick={() => {
props.onClick(job);
}}
>
<ListItemText primary={job.title} secondary={job.career_level} />
</ListItem>
))}
</List>
</Drawer>
</div>````
What you're probably looking for is the variant='persistent' drawer
import * as React from 'react';
import { styled, useTheme } from '#mui/material/styles';
import Box from '#mui/material/Box';
import Drawer from '#mui/material/Drawer';
import CssBaseline from '#mui/material/CssBaseline';
import MuiAppBar from '#mui/material/AppBar';
import Toolbar from '#mui/material/Toolbar';
import List from '#mui/material/List';
import Typography from '#mui/material/Typography';
import Divider from '#mui/material/Divider';
import IconButton from '#mui/material/IconButton';
import MenuIcon from '#mui/icons-material/Menu';
import ChevronLeftIcon from '#mui/icons-material/ChevronLeft';
import ChevronRightIcon from '#mui/icons-material/ChevronRight';
import ListItem from '#mui/material/ListItem';
import ListItemIcon from '#mui/material/ListItemIcon';
import ListItemText from '#mui/material/ListItemText';
import InboxIcon from '#mui/icons-material/MoveToInbox';
import MailIcon from '#mui/icons-material/Mail';
const drawerWidth = 240;
const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })(
({ theme, open }) => ({
flexGrow: 1,
padding: theme.spacing(3),
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
marginLeft: `-${drawerWidth}px`,
...(open && {
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
marginLeft: 0,
}),
}),
);
const AppBar = styled(MuiAppBar, {
shouldForwardProp: (prop) => prop !== 'open',
})(({ theme, open }) => ({
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
...(open && {
width: `calc(100% - ${drawerWidth}px)`,
marginLeft: `${drawerWidth}px`,
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
}),
}));
const DrawerHeader = styled('div')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
padding: theme.spacing(0, 1),
// necessary for content to be below app bar
...theme.mixins.toolbar,
justifyContent: 'flex-end',
}));
export default function PersistentDrawerLeft() {
const theme = useTheme();
const [open, setOpen] = React.useState(false);
const handleDrawerOpen = () => {
setOpen(true);
};
const handleDrawerClose = () => {
setOpen(false);
};
return (
<Box sx={{ display: 'flex' }}>
<CssBaseline />
<AppBar position="fixed" open={open}>
<Toolbar>
<IconButton
color="inherit"
aria-label="open drawer"
onClick={handleDrawerOpen}
edge="start"
sx={{ mr: 2, ...(open && { display: 'none' }) }}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" noWrap component="div">
Persistent drawer
</Typography>
</Toolbar>
</AppBar>
<Drawer
sx={{
width: drawerWidth,
flexShrink: 0,
'& .MuiDrawer-paper': {
width: drawerWidth,
boxSizing: 'border-box',
},
}}
variant="persistent"
anchor="left"
open={open}
>
<DrawerHeader>
<IconButton onClick={handleDrawerClose}>
{theme.direction === 'ltr' ? <ChevronLeftIcon /> : <ChevronRightIcon />}
</IconButton>
</DrawerHeader>
<Divider />
<List>
{['Inbox', 'Starred', 'Send email', 'Drafts'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>
{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
</List>
<Divider />
<List>
{['All mail', 'Trash', 'Spam'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>
{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
</List>
</Drawer>
<Main open={open}>
<DrawerHeader />
<Typography paragraph>
Content
</Typography>
<Typography paragraph>
More content
</Typography>
</Main>
</Box>
);
}

How to reference CSS Classes in a different class in Material UI

I want to reference a CSS class in another CSS class present in the same makeStyles hook.
import React from 'react';
import { makeStyles, Typography, Grid } from '#material-ui/core';
const styles = makeStyles((theme) => ({
root: {},
textStyle: {
fontFamily: 'Brandon',
textTransform: 'uppercase',
cursor: 'pointer',
'&:hover': {
color: `${theme.palette.primary.contrastText} !important`,
$dropDown: {
// I want to apply this style to the dropDown class when I hover over the textStyle Class
opacity: 1,
},
},
},
dropDown: {
width: 'max-content',
position: 'absolute',
top: '80px',
backgroundColor: 'tomato',
pointerEvents: 'none',
opacity: 0, // manipulate this
},
dropDownList: {
padding: '30px 0px 50px',
minWidth: '200px',
position: 'relative',
width: 'auto',
},
text: {
// fontFamily: 'Brandon',
padding: '4px 0px',
},
dropDownItem: {
padding: '5px 0px',
},
}));
const Shop: React.FC = () => {
const classes = styles();
const trendingArr = [
'New Arrivals',
'Best Sellers',
'The Summer Edit',
'FRAME & Mejuri',
'New Arrivals',
'Best Sellers',
'The Summer Edit',
'FRAME & Mejuri',
];
return (
<>
<Typography variant='body1' className={classes.textStyle}>
Shop
</Typography>
<Grid container direction='row' className={classes.dropDown}>
<Grid
container
direction='column'
className={classes.dropDownList}
>
<Typography variant='body2' className={classes.text}>
<b>Trending</b>
</Typography>
{trendingArr.map((item, i) => (
<Typography
className={classes.dropDownItem}
variant='body2'
key={i}
>
{item}
</Typography>
))}
</Grid>
{/* another one */}
<Grid
container
direction='column'
className={classes.dropDownList}
>
<Typography variant='body2' className={classes.text}>
<b>Trending</b>
</Typography>
{trendingArr.map((item, i) => (
<Typography
className={classes.dropDownItem}
variant='body2'
key={i}
>
{item}
</Typography>
))}
</Grid>
</Grid>
</>
);
};
export default Shop;
I want to reference the dropDown class inside the hover selector of textStyle to change the opacity whenever I hover over the textStyle class. How can I achieve it ?

How can I scroll on my Page when my Dialog Component has been opened

I want to scroll on the background, when my dialog component opens up. By default, you cannot scroll when the dialog appears. How can I scroll in the background ?
Following is the Code:-
import React, { useState } from 'react';
import {
makeStyles,
Grid,
Button,
Dialog,
DialogActions,
DialogTitle,
} from '#material-ui/core';
import ShoppingCartIcon from '#material-ui/icons/ShoppingCart';
import CloseIcon from '#material-ui/icons/Close';
const styles = makeStyles((theme) => ({
root: {
position: 'fixed',
bottom: '0 ',
left: '0',
right: '0',
boxShadow: '0 0 6px rgb(0 0 0 / 70%)',
backgroundColor: 'white',
height: '63px',
},
textStyle: {
fontFamily: 'Comfortaa',
},
icon: {
color: theme.palette.primary.dark,
},
btn: {
backgroundColor: theme.palette.primary.dark,
color: 'white',
fontFamily: 'Comfortaa',
'&:hover': {
backgroundColor: theme.palette.primary.dark,
},
},
title: {
display: 'flex',
justifyContent: 'flex-end',
borderBottom: '1px solid #e5e5e5',
},
closeIcon: {
color: theme.palette.primary.light,
'&:hover': {
color: 'black',
},
},
dialogStyle: {
backgroundColor: 'white',
position: 'absolute',
top: 0,
},
dialogContainer: {
opacity: 0,
},
dialogTitle: {
display: 'flex',
justifyContent: 'flex-end',
borderBottom: '1px solid #e5e5e5',
},
}));
const CartAppBar: React.FC = () => {
const classes = styles();
const [open, setOpen] = useState(false);
const handleClickOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
return (
<>
<Grid
item
container
direction='row'
justify='space-around'
alignItems='center'
className={classes.root}
xs={12}
>
<div>
<ShoppingCartIcon
fontSize='large'
classes={{ root: classes.icon }}
onClick={handleClickOpen}
/>
</div>
<div>
<Button
className={classes.btn}
type='submit'
onClick={() => {
return (window.location.href = '/checkout');
}}
>
Checkout
</Button>
</div>
</Grid>
<Dialog
open={open}
onClose={handleClose}
aria-labelledby='alert-dialog-title'
aria-describedby='alert-dialog-description'
maxWidth='md'
fullWidth
classes={{
paper: classes.dialogStyle,
container: classes.dialogContainer,
}}
scroll='paper'
>
<DialogTitle className={classes.dialogTitle}>
<CloseIcon
onClick={handleClose}
classes={{ root: classes.closeIcon }}
/>
</DialogTitle>
{/* Footer */}
{/* <DialogActions className={classes.footer}>
<Button classes={{ root: classes.btn }}>Add To Cart</Button>
</DialogActions> */}
</Dialog>
</>
);
};
export default CartAppBar;
As you can see in the photo, there's opacity in the background and you cannot scroll. I want to override this and make the background scrollable
use disableScrollLock as prop will help

Resources