Revize 40e45314
Přidáno uživatelem Václav Honzík před asi 2 roky(ů)
frontend/src/features/TrackingTool/DraggableList/DraggableList.tsx | ||
---|---|---|
1 | 1 |
import { memo } from 'react' |
2 |
import { DragDropContext, Droppable, OnDragEndResponder } from 'react-beautiful-dnd' |
|
2 |
import { |
|
3 |
DragDropContext, |
|
4 |
Droppable, |
|
5 |
OnDragEndResponder, |
|
6 |
} from 'react-beautiful-dnd' |
|
3 | 7 |
import { MapPoint } from '../Map/pathUtils' |
4 | 8 |
import DraggableListItem from './DraggableListItem' |
5 | 9 |
|
... | ... | |
9 | 13 |
} |
10 | 14 |
|
11 | 15 |
const DraggableList = memo(({ items, onDragEnd }: DraggableListProps) => { |
16 |
window.addEventListener('error', (e) => { |
|
17 |
if ( |
|
18 |
e.message === |
|
19 |
'ResizeObserver loop completed with undelivered notifications.' || |
|
20 |
e.message === 'ResizeObserver loop limit exceeded' |
|
21 |
) { |
|
22 |
e.stopImmediatePropagation() |
|
23 |
} |
|
24 |
}) |
|
25 |
|
|
12 | 26 |
return ( |
13 | 27 |
<DragDropContext onDragEnd={onDragEnd}> |
14 | 28 |
<Droppable droppableId="droppable-list"> |
... | ... | |
17 | 31 |
{items.map((item, index) => ( |
18 | 32 |
<DraggableListItem |
19 | 33 |
list={items} |
20 |
index={index}
|
|
34 |
idx={index}
|
|
21 | 35 |
key={item.id} |
22 | 36 |
/> |
23 | 37 |
))} |
Také k dispozici: Unified diff
reidxing + drag jump fix