Skip to content

Commit

Permalink
fix: optimize zIndex (#289)
Browse files Browse the repository at this point in the history
* fix: operations zIndex

* fix: operations zIndex

* feat: optimize code
  • Loading branch information
kiner-tang committed Nov 23, 2023
1 parent 9e3e69c commit c7ce546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const Preview: React.FC<PreviewProps> = props => {
onFlipX={onFlipX}
onFlipY={onFlipY}
onClose={onClose}
zIndex={restProps.zIndex}
zIndex={restProps.zIndex !== undefined ? restProps.zIndex + 1 : undefined}
/>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion tests/basic.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ describe('Basic', () => {
/>,
);
const operationsElement = baseElement.querySelector('.rc-image-preview-operations-wrapper');
expect(operationsElement).toHaveStyle({ zIndex: 9999 });
expect(operationsElement).toHaveStyle({ zIndex: 10000 });
});
});

1 comment on commit c7ce546

@vercel
Copy link

@vercel vercel bot commented on c7ce546 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.