Skip to content

Commit c7ce546

Browse files
authored
fix: optimize zIndex (#289)
* fix: operations zIndex * fix: operations zIndex * feat: optimize code
1 parent 9e3e69c commit c7ce546

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ const Preview: React.FC<PreviewProps> = props => {
324324
onFlipX={onFlipX}
325325
onFlipY={onFlipY}
326326
onClose={onClose}
327-
zIndex={restProps.zIndex}
327+
zIndex={restProps.zIndex !== undefined ? restProps.zIndex + 1 : undefined}
328328
/>
329329
</>
330330
);

tests/basic.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ describe('Basic', () => {
9595
/>,
9696
);
9797
const operationsElement = baseElement.querySelector('.rc-image-preview-operations-wrapper');
98-
expect(operationsElement).toHaveStyle({ zIndex: 9999 });
98+
expect(operationsElement).toHaveStyle({ zIndex: 10000 });
9999
});
100100
});

0 commit comments

Comments
 (0)