From b1e61245ee9b2f7f7c9693b2ae83f70cc79fd386 Mon Sep 17 00:00:00 2001 From: pengx17 Date: Fri, 13 Sep 2024 10:11:18 +0000 Subject: [PATCH] fix: button tooltip should not show on showing image preview (#8224) when showing image preview in modal, the following code https://github.com/radix-ui/primitives/blob/660060a765634e9cc7bf4513f41e8dabc9824d74/packages/react/focus-scope/src/FocusScope.tsx#L143 will find the first tabbable element and focus, which will trigger the button's tooltip Adding tabIndex to the image to fix this issue --- .../core/src/modules/peek-view/view/image-preview/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx b/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx index 5b0779db20..2473f40d5e 100644 --- a/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx +++ b/packages/frontend/core/src/modules/peek-view/view/image-preview/index.tsx @@ -308,6 +308,7 @@ const ImagePreviewModalImpl = ({ data-testid="image-content" src={url} alt={caption} + tabIndex={0} ref={imageRef} draggable={isZoomedBigger} onMouseDown={handleDragStart}