Fix double scroll issue on add produtct to draft order (#3355)
* Fix double scroll issue on add produtct to draft order * Fix double scroll approche 2 * Max height 75vh * Fix rest of scrolls
This commit is contained in:
parent
71de66f9cc
commit
2d331a15d8
4 changed files with 10 additions and 23 deletions
|
@ -44,3 +44,7 @@ body {
|
||||||
.remove-icon-background svg {
|
.remove-icon-background svg {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[id*="ScrollableDialog"] .infinite-scroll-component {
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
|
@ -16,8 +16,9 @@ export const useStyles = makeStyles(
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
overflowY: "scroll",
|
overflowY: "auto",
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
|
maxHeight: "75vh",
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
},
|
},
|
||||||
subtitle: {
|
subtitle: {
|
||||||
|
|
|
@ -95,12 +95,6 @@ const useStyles = makeStyles(
|
||||||
overflow: {
|
overflow: {
|
||||||
overflowY: "visible",
|
overflowY: "visible",
|
||||||
},
|
},
|
||||||
scrollArea: {
|
|
||||||
maxHeight: 400,
|
|
||||||
overflowY: "scroll",
|
|
||||||
paddingTop: 0,
|
|
||||||
paddingBottom: 0,
|
|
||||||
},
|
|
||||||
table: {
|
table: {
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
},
|
},
|
||||||
|
@ -140,8 +134,6 @@ function handleStaffMemberAssign(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollableTargetId = "assignMembersScrollableDialog";
|
|
||||||
|
|
||||||
const AssignMembersDialog: React.FC<AssignMembersDialogProps> = ({
|
const AssignMembersDialog: React.FC<AssignMembersDialogProps> = ({
|
||||||
confirmButtonState,
|
confirmButtonState,
|
||||||
disabled,
|
disabled,
|
||||||
|
@ -194,11 +186,7 @@ const AssignMembersDialog: React.FC<AssignMembersDialogProps> = ({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogContent
|
<DialogContent ref={anchor}>
|
||||||
className={classes.scrollArea}
|
|
||||||
ref={anchor}
|
|
||||||
id={scrollableTargetId}
|
|
||||||
>
|
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
dataLength={staffMembers?.length || 0}
|
dataLength={staffMembers?.length || 0}
|
||||||
next={onFetchMore}
|
next={onFetchMore}
|
||||||
|
@ -212,7 +200,7 @@ const AssignMembersDialog: React.FC<AssignMembersDialogProps> = ({
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
scrollableTarget={scrollableTargetId}
|
height={400}
|
||||||
>
|
>
|
||||||
<ResponsiveTable className={classes.table}>
|
<ResponsiveTable className={classes.table}>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
|
|
|
@ -37,10 +37,6 @@ const useStyles = makeStyles(
|
||||||
colName: {
|
colName: {
|
||||||
paddingLeft: 0,
|
paddingLeft: 0,
|
||||||
},
|
},
|
||||||
content: {
|
|
||||||
overflowY: "scroll",
|
|
||||||
height: 450,
|
|
||||||
},
|
|
||||||
searchBar: {
|
searchBar: {
|
||||||
marginBottom: theme.spacing(3),
|
marginBottom: theme.spacing(3),
|
||||||
},
|
},
|
||||||
|
@ -94,8 +90,6 @@ const handleProductAssign = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrollableTargetId = "shippingMethodProductsAddScrollableDialog";
|
|
||||||
|
|
||||||
const ShippingMethodProductsAddDialog: React.FC<
|
const ShippingMethodProductsAddDialog: React.FC<
|
||||||
ShippingMethodProductsAddDialogProps
|
ShippingMethodProductsAddDialogProps
|
||||||
> = props => {
|
> = props => {
|
||||||
|
@ -161,7 +155,7 @@ const ShippingMethodProductsAddDialog: React.FC<
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.content} id={scrollableTargetId}>
|
<div>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
dataLength={products?.length}
|
dataLength={products?.length}
|
||||||
next={onFetchMore}
|
next={onFetchMore}
|
||||||
|
@ -172,7 +166,7 @@ const ShippingMethodProductsAddDialog: React.FC<
|
||||||
<CircularProgress size={16} />
|
<CircularProgress size={16} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
scrollableTarget={scrollableTargetId}
|
height={450}
|
||||||
>
|
>
|
||||||
<ResponsiveTable key="table">
|
<ResponsiveTable key="table">
|
||||||
<TableBody>
|
<TableBody>
|
||||||
|
|
Loading…
Reference in a new issue