Create tooltips' pinnable persistent variable immediately

This commit is contained in:
thepaperpilot 2022-07-09 20:46:42 -05:00
parent 9828e5ec62
commit 439e10d7b1

View file

@ -70,7 +70,6 @@ export function addTooltip<T extends TooltipOptions>(
processComputable(options as T, "xoffset"); processComputable(options as T, "xoffset");
processComputable(options as T, "yoffset"); processComputable(options as T, "yoffset");
nextTick(() => {
if (options.pinnable) { if (options.pinnable) {
if ("pinned" in element) { if ("pinned" in element) {
console.error( console.error(
@ -83,6 +82,7 @@ export function addTooltip<T extends TooltipOptions>(
} }
} }
nextTick(() => {
const elementComponent = element[Component]; const elementComponent = element[Component];
element[Component] = TooltipComponent; element[Component] = TooltipComponent;
const elementGatherProps = element[GatherProps].bind(element); const elementGatherProps = element[GatherProps].bind(element);