From b265956083361023adf271950e3ac8b67be21e8c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sat, 15 Jul 2023 20:47:02 +1000 Subject: [PATCH] fix(ui): disable drop when controlnet disabled --- .../web/src/common/components/IAIDndImage.tsx | 14 ++++++++------ .../components/ControlNetImagePreview.tsx | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx index 59a1d281fe..991398f5a0 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx @@ -170,12 +170,14 @@ const IAIDndImage = (props: IAIDndImageProps) => { </> )} {!imageDTO && isUploadDisabled && noContentFallback} - <IAIDroppable - data={droppableData} - disabled={isDropDisabled} - dropLabel={dropLabel} - /> - {imageDTO && ( + {!isDropDisabled && ( + <IAIDroppable + data={droppableData} + disabled={isDropDisabled} + dropLabel={dropLabel} + /> + )} + {imageDTO && !isDragDisabled && ( <IAIDraggable data={draggableData} disabled={isDragDisabled || !imageDTO} diff --git a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx index bb4ca07bbb..2faec4737d 100644 --- a/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx +++ b/invokeai/frontend/web/src/features/controlNet/components/ControlNetImagePreview.tsx @@ -133,7 +133,7 @@ const ControlNetImagePreview = (props: Props) => { draggableData={draggableData} droppableData={droppableData} imageDTO={controlImage} - isDropDisabled={shouldShowProcessedImage} + isDropDisabled={shouldShowProcessedImage || !isEnabled} onClickReset={handleResetControlImage} postUploadAction={postUploadAction} resetTooltip="Reset Control Image" @@ -157,6 +157,7 @@ const ControlNetImagePreview = (props: Props) => { droppableData={droppableData} imageDTO={processedControlImage} isUploadDisabled={true} + isDropDisabled={!isEnabled} onClickReset={handleResetControlImage} resetTooltip="Reset Control Image" withResetIcon={Boolean(controlImage)}