Skip to content

Commit

Permalink
Update packages/x-charts/src/hooks/useInteractionItemProps.ts
Browse files Browse the repository at this point in the history
Signed-off-by: Jose C Quintas Jr <[email protected]>
  • Loading branch information
JCQuintas authored Nov 26, 2024
1 parent 6d224a3 commit 5ca45ca
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions packages/x-charts/src/hooks/useInteractionItemProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,7 @@ export const useInteractionItemProps = (skip?: boolean) => {
event.currentTarget.releasePointerCapture(event.pointerId);
}

store.update((prev) => {
const prevItem = prev.interaction.item;
if (
prevItem === null ||
Object.keys(data).some(
(key) => data[key as keyof typeof data] !== prevItem[key as keyof typeof prevItem],
)
) {
// The item is already something else, no need to clean it.
return prev;
}
return {
...prev,
interaction: {
...prev.interaction,
item: null,
},
};
});
dispatchInteraction({ type: 'leaveItem', data });
clearHighlighted();
};
return {
Expand Down

0 comments on commit 5ca45ca

Please sign in to comment.