Skip to content

Commit

Permalink
⚡️ Disable chart tooltip on drag
Browse files Browse the repository at this point in the history
  • Loading branch information
pehovorka committed Apr 16, 2022
1 parent 3e91bd7 commit 3861d64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/card/DragAndDropCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function DragAndDropCards({ municipalities }) {
return (
<DragDropContext onDragEnd={handleOnDragEnd}>
<Droppable droppableId="municipalities">
{(provided) => (
{(provided, snapshot) => (
<Box {...provided.droppableProps} ref={provided.innerRef} mt={1}>
{municipalities.map((municipality, index) => (
<Draggable
Expand All @@ -50,6 +50,7 @@ export default function DragAndDropCards({ municipalities }) {
index={index}
provided={provided}
handleDateLimitChange={handleDateLimitChange}
isDraggingOver={snapshot.isDraggingOver}
/>
</Box>
)}
Expand Down
8 changes: 7 additions & 1 deletion src/components/card/MunicipalityCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function MunicipalityCard({
provided,
closeButtonHidden,
handleDateLimitChange,
isDraggingOver,
}) {
const dispatch = useMunicipalitiesDispatch();

Expand Down Expand Up @@ -136,7 +137,11 @@ export default function MunicipalityCard({
}
title={name}
/>
<CardContent>
<CardContent
style={{
...(isDraggingOver && { pointerEvents: "none" }),
}}
>
<MunicipalityCasesStats municipality={municipality} code={code} />
<Suspense
fallback={
Expand Down Expand Up @@ -177,4 +182,5 @@ MunicipalityCard.propTypes = {
provided: PropTypes.object,
closeButtonHidden: PropTypes.bool,
handleDateLimitChange: PropTypes.func,
isDraggingOver: PropTypes.bool,
};

0 comments on commit 3861d64

Please sign in to comment.