Skip to content

Commit 97439c1

Browse files
fix(ui): native context menu shown on right click on short fat images
Closes #8254
1 parent b23bff1 commit 97439c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const GalleryImage = memo(({ imageDTO }: Props) => {
143143
DndDragPreviewSingleImageState | DndDragPreviewMultipleImageState | null
144144
>(null);
145145
// Must use callback ref - else chakra's Image fallback prop will break the ref & dnd
146-
const [element, ref] = useState<HTMLImageElement | null>(null);
146+
const [element, ref] = useState<HTMLDivElement | null>(null);
147147
const selectIsSelectedForCompare = useMemo(
148148
() => createSelector(selectGallerySlice, (gallery) => gallery.imageToCompare === imageDTO.image_name),
149149
[imageDTO.image_name]
@@ -246,6 +246,7 @@ export const GalleryImage = memo(({ imageDTO }: Props) => {
246246
<>
247247
<Box sx={galleryImageContainerSX} data-is-dragging={isDragging} data-image-name={imageDTO.image_name}>
248248
<Flex
249+
ref={ref}
249250
role="button"
250251
className={GALLERY_IMAGE_CLASS}
251252
onMouseOver={onMouseOver}
@@ -256,7 +257,6 @@ export const GalleryImage = memo(({ imageDTO }: Props) => {
256257
data-selected-for-compare={isSelectedForCompare}
257258
>
258259
<Image
259-
ref={ref}
260260
src={imageDTO.thumbnail_url}
261261
w={imageDTO.width}
262262
fallback={<GalleryImagePlaceholder />}

0 commit comments

Comments
 (0)