fix: keep canvas selection when clicking workspace overlay controls
This commit is contained in:
parent
b968deee62
commit
fa3460d719
@ -193,7 +193,7 @@ export function CanvasWorkspace() {
|
||||
|
||||
const isPointOnNodeElement = useCallback((target: EventTarget | null) => {
|
||||
if (!(target instanceof HTMLElement)) return false;
|
||||
return !!target.closest("[data-canvas-node-id]");
|
||||
return !!target.closest("[data-canvas-node-id], [data-canvas-overlay]");
|
||||
}, []);
|
||||
|
||||
const isEventFromCanvasContainer = useCallback((target: EventTarget | null) => {
|
||||
@ -808,7 +808,7 @@ export function CanvasWorkspace() {
|
||||
|
||||
{/* 缩放控制器 */}
|
||||
{selectedImageNodes.length > 0 && (
|
||||
<div className="absolute bottom-4 left-4 z-30">
|
||||
<div className="absolute bottom-4 left-4 z-30" data-canvas-overlay>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
@ -823,7 +823,10 @@ export function CanvasWorkspace() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="absolute bottom-4 right-4 bg-background/80 backdrop-blur-sm rounded-lg flex items-center gap-1 px-1 py-1 shadow-sm border border-border/50">
|
||||
<div
|
||||
className="absolute bottom-4 right-4 bg-background/80 backdrop-blur-sm rounded-lg flex items-center gap-1 px-1 py-1 shadow-sm border border-border/50"
|
||||
data-canvas-overlay
|
||||
>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user