-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show popup at the same document as the trigger element #227
show popup at the same document as the trigger element #227
Conversation
Codecov Report
@@ Coverage Diff @@
## master #227 +/- ##
==========================================
+ Coverage 88.95% 89.01% +0.06%
==========================================
Files 11 11
Lines 516 519 +3
Branches 130 131 +1
==========================================
+ Hits 459 462 +3
Misses 57 57
Continue to review full report at Codecov.
|
function returnDocument() { | ||
function returnDocument(element?: HTMLElement) { | ||
if (element) { | ||
return element.ownerDocument; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be
return element.ownerDocument; | |
return element.getRootNode?.() || element.ownerDocument; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
popup can not be created in shadow dom.
the reason we need this package for popup is because popup should stay on top of everything.
showing popup in shadow dom means it can be blocked by parentNode's overflow style or by other elements.
for special case when you really need it to be inside shadow-dom, could you use getPopupContainer ?
…nt#227) * show popup at the same document as the trigger element * use current document in all use cases
use getRootDomNode() to find the correct document instead of using the default global one.
resolves ant-design/ant-design#28165