Skip to content

Commit

Permalink
fix: issue with re-rendering on hover outside of editor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite committed Jul 8, 2022
1 parent 89cce2c commit a395206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-align",
"version": "2.0.5",
"version": "2.0.6",
"author": "KaWaite",
"module": "dist/react-align.esm.js",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions src/GridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default function GridItem({
[disabled, editing, extendable, extended, id, index, isDragging, isHovered]
);

console.log('hey');
return (
<Draggable draggableId={id} index={index} isDragDisabled={disabled}>
{(provided, snapshot) => (
Expand Down Expand Up @@ -114,8 +115,8 @@ export default function GridItem({
: undefined,
height: vertical && extended ? '100%' : undefined,
}}
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
onMouseEnter={() => editing && setHovered(true)}
onMouseLeave={() => editing && setHovered(false)}
>
{typeof children === 'function' ? children(ctx) : children}
<div
Expand Down

0 comments on commit a395206

Please sign in to comment.