fix: Fixed image preview in a nested pop-up where z-index Settings did not meet expectations #45979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
fix #45975
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖[deprecated] Generated by Copilot at d93d306
Added z-index management for the
Image
component with a preview feature. Used theuseZIndex
hook to assign z-index values to the image preview elements and updated therc-image
dependency to support thezIndex
prop. Added a test case for theuseZIndex
hook with theImage
component.🔍 Walkthrough
🤖[deprecated] Generated by Copilot at d93d306
rc-image
dependency to use the latest version that supports thezIndex
prop for thePreviewGroup
component (link)useZIndex
hook inImage
component to get the z-index value for the preview element based on theImagePreview
consumer and the optionalzIndex
prop from thepreview
object (link, link, link)PreviewGroup
component as a prop to set the z-index of the preview element (link)ZIndexConsumer
type andconsumerBaseZIndexOffset
object to include theImagePreview
consumer and assign a base z-index offset value of 1 to it (link, link)ImagePreview
component to theuseZIndex
test file and importImage
component andImageProps
type fromantd
to use them in theImagePreview
component (link, link, link)getConsumerSelector
function in theuseZIndex
test file to handle theImagePreview
consumer case and return the appropriate selector for the preview element based on the root class name (link)