-
Notifications
You must be signed in to change notification settings - Fork 330
fix(popper): [tooltip,popover] fix popper doms in custom element, cant get zindex #3126
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,10 @@ const isFixed = (el: HTMLElement) => { | |
| return true | ||
| } | ||
|
|
||
| // 处理遇到 shadowRoot的情况 | ||
| if (el.host) { | ||
| el = el.host | ||
| } | ||
| return el.parentNode ? isFixed(el.parentNode as HTMLElement) : false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that |
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,11 @@ const getReferMaxZIndex = (reference) => { | |
| do { | ||
| reference = reference.parentNode | ||
|
|
||
| // 处理遇到shadowRoot的情况 | ||
| if (reference && reference instanceof ShadowRoot && reference.host) { | ||
| reference = reference.host | ||
| } | ||
|
|
||
| if (reference) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that |
||
| z = getZIndex(reference) | ||
| } else { | ||
|
|
||
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.
Ensure that
el.getAttribute('data-tag')is not null before using it in theincludesmethod to avoid potential runtime errors.