release/2025-04-25: Patch Updates to packages

This commit is contained in:
Dave Richer
2025-04-26 12:16:46 -04:00
parent 2e7f827c3f
commit 3c4ed3ba0c
8 changed files with 34 additions and 789 deletions

View File

@@ -100,26 +100,28 @@ const BoardContainer = ({
const onLaneDrag = useCallback(
async ({ draggableId, type, source, reason, mode, destination, combine }) => {
setIsDragging(false);
setDragTime(source.droppableId);
if (!type || type !== "lane" || !source || !destination || isEqual(source, destination)) return;
setIsProcessing(true);
// Only update drag time if it's a valid drop with a different destination
if (type === "lane" && source && destination && !isEqual(source, destination)) {
setDragTime(source.droppableId);
setIsProcessing(true);
dispatch(
actions.moveCardAcrossLanes({
fromLaneId: source.droppableId,
toLaneId: destination.droppableId,
cardId: draggableId,
index: destination.index
})
);
dispatch(
actions.moveCardAcrossLanes({
fromLaneId: source.droppableId,
toLaneId: destination.droppableId,
cardId: draggableId,
index: destination.index
})
);
try {
await onDragEnd({ draggableId, type, source, reason, mode, destination, combine });
} catch (err) {
console.error("Error in onLaneDrag", err);
} finally {
setIsProcessing(false);
try {
await onDragEnd({ draggableId, type, source, reason, mode, destination, combine });
} catch (err) {
console.error("Error in onLaneDrag", err);
} finally {
setIsProcessing(false);
}
}
},
[dispatch, onDragEnd, setDragTime]

View File

@@ -120,15 +120,14 @@ const Lane = ({
const Component = orientation === "vertical" ? VirtuosoGrid : Virtuoso;
const FinalComponent = collapsed ? "div" : Component;
const commonProps = {
useWindowScroll: true,
data: renderedCards
data: renderedCards,
customScrollParent: laneRef.current
};
const verticalProps = {
...commonProps,
listClassName: "grid-container",
itemClassName: "grid-item",
customScrollParent: laneRef.current,
components: {
List: ListComponent,
Item: ItemComponent
@@ -142,7 +141,6 @@ const Lane = ({
components: { Item: HeightPreservingItem },
overscan: { main: 3, reverse: 3 },
itemContent: (index, item) => renderDraggable(index, item),
scrollerRef: provided.innerRef,
style: {
minWidth: maxCardWidth,
minHeight: maxLaneHeight
@@ -180,13 +178,14 @@ const Lane = ({
override={orientation !== "horizontal" && (collapsed || !renderedCards.length)}
>
<div
{...provided.droppableProps}
ref={provided.innerRef}
ref={laneRef} // Ensure laneRef is set here
style={{ height: "100%", width: "100%" }} // Make it scrollable
className={`react-trello-lane ${collapsed ? "lane-collapsed" : ""}`}
style={{ ...provided.droppableProps.style }}
>
<FinalComponent {...finalComponentProps} />
{shouldRenderPlaceholder && provided.placeholder}
<div {...provided.droppableProps} ref={provided.innerRef} style={{ ...provided.droppableProps.style }}>
<FinalComponent {...finalComponentProps} />
{shouldRenderPlaceholder && provided.placeholder}
</div>
</div>
</HeightMemoryWrapper>
);