Hide the hover magnifier while dragging a card to arrange.
This commit is contained in:
@@ -15,6 +15,9 @@ interface Props {
|
||||
dead?: boolean
|
||||
// preview marks the floating magnified copy so it doesn't magnify itself.
|
||||
preview?: boolean
|
||||
// noMagnify suppresses the hover magnifier (e.g. while this card is being
|
||||
// dragged, so the frozen preview copy doesn't linger over the drag ghost).
|
||||
noMagnify?: boolean
|
||||
}
|
||||
|
||||
// CardView renders one physical card: pets get a power badge and a colored
|
||||
@@ -30,6 +33,7 @@ export function CardView({
|
||||
damage = 0,
|
||||
dead,
|
||||
preview,
|
||||
noMagnify,
|
||||
}: Props) {
|
||||
// Hover magnifier: show a large floating copy beside the cursor. The
|
||||
// preview copy itself opts out so it can't recurse.
|
||||
@@ -49,7 +53,7 @@ export function CardView({
|
||||
|
||||
// Place the magnified preview near the cursor, clamped into the viewport.
|
||||
const previewEl =
|
||||
hover && !preview
|
||||
hover && !preview && !noMagnify
|
||||
? createPortal(
|
||||
<div
|
||||
className="card-magnify"
|
||||
|
||||
Reference in New Issue
Block a user