agentation-vue 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,6 +43,12 @@ function isHostDisabled(el) {
|
|
|
43
43
|
return Boolean(el.disabled);
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
|
+
function getTooltipContainer(el) {
|
|
47
|
+
const root = el.getRootNode();
|
|
48
|
+
if (root instanceof ShadowRoot)
|
|
49
|
+
return root;
|
|
50
|
+
return document.body;
|
|
51
|
+
}
|
|
46
52
|
function createTooltipElement(value) {
|
|
47
53
|
const tooltipEl = document.createElement("div");
|
|
48
54
|
tooltipEl.className = "__va-tooltip";
|
|
@@ -125,8 +131,9 @@ function showTooltipNow(el) {
|
|
|
125
131
|
state.tooltipEl = createTooltipElement(state.value);
|
|
126
132
|
else
|
|
127
133
|
updateTooltipContent(state.tooltipEl, state.value);
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
const container = getTooltipContainer(el);
|
|
135
|
+
if (state.tooltipEl.parentNode !== container)
|
|
136
|
+
container.appendChild(state.tooltipEl);
|
|
130
137
|
positionTooltip(el);
|
|
131
138
|
state.tooltipEl.classList.add("__va-tooltip--visible");
|
|
132
139
|
attachWindowListeners(el);
|