📝[RFC] Support zIndexContext to manage popup's zIndex in Pop-up container #45154
kiner-tang
announced in
RFCs - archive
Replies: 1 comment 1 reply
-
For the popup part which should provider a algorithm with the offset calculation. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
At present, in many pop-up containers, such as Modal, Drawer, Popover, etc., some internal elements with pop-up interaction, such as Select, Dropdown, etc., often appear when the pop-up box of these elements is missing during operation.
The root cause is that these pop-ups are implemented in a way that is separated from the parent element, which causes the z-index of the current element to be smaller than that of the popup container, and eventually the popup is blocked by the container and not visible.
Currently we can solve this problem by configuring
getPopupContainer
in theConfigProvider
to specify the parent of the current element, but there are still some drawbacks, that is, if the parent element is set tooverflow: hidden
, our popup will be intercepted.Therefore, we are eager to find a way to better manage the z-index of the pop-up subcomponents in these pop-up containers.
Motivation
As mentioned above and mentioned #44958, We need all pop-up containers to provide their own z-index as a context to pass to the subcomponents, if the subcomponents is a pop-up interaction component, it will consume the context, get the parent container's z-index, And on the basis of the z-index of the parent container, add their own z-index to get the final level information.
Change list
Container(ContextProvider)
SubComponents(ContextConsumer)
API
Example
Detail
This change is not user-aware, and only antd needs to be changed, rc-components do not need to be changed.
Beta Was this translation helpful? Give feedback.
All reactions