fixes #6103 --------- Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
committed by
GitHub
parent
f24536c115
commit
284e75791c
@ -218,6 +218,7 @@ export const SettingsDataModelFieldSelectForm = ({
|
|||||||
<>
|
<>
|
||||||
{options.map((option, index) => (
|
{options.map((option, index) => (
|
||||||
<DraggableItem
|
<DraggableItem
|
||||||
|
isInsideScrollableContainer
|
||||||
key={option.id}
|
key={option.id}
|
||||||
draggableId={option.id}
|
draggableId={option.id}
|
||||||
index={index}
|
index={index}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ type DraggableItemProps = {
|
|||||||
isDragDisabled?: boolean;
|
isDragDisabled?: boolean;
|
||||||
index: number;
|
index: number;
|
||||||
itemComponent: JSX.Element;
|
itemComponent: JSX.Element;
|
||||||
|
isInsideScrollableContainer?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DraggableItem = ({
|
export const DraggableItem = ({
|
||||||
@ -14,6 +15,7 @@ export const DraggableItem = ({
|
|||||||
isDragDisabled = false,
|
isDragDisabled = false,
|
||||||
index,
|
index,
|
||||||
itemComponent,
|
itemComponent,
|
||||||
|
isInsideScrollableContainer,
|
||||||
}: DraggableItemProps) => {
|
}: DraggableItemProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
@ -36,7 +38,7 @@ export const DraggableItem = ({
|
|||||||
style={{
|
style={{
|
||||||
...draggableStyle,
|
...draggableStyle,
|
||||||
left: 'auto',
|
left: 'auto',
|
||||||
top: 'auto',
|
...(isInsideScrollableContainer ? {} : { top: 'auto' }),
|
||||||
transform: draggableStyle?.transform?.replace(
|
transform: draggableStyle?.transform?.replace(
|
||||||
/\(-?\d+px,/,
|
/\(-?\d+px,/,
|
||||||
'(0,',
|
'(0,',
|
||||||
|
|||||||
Reference in New Issue
Block a user