Skip to content

Commit

Permalink
fix: KTour component positioning inaccurate
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c committed Jan 22, 2025
1 parent 1cec3e7 commit d752287
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/Tour/src/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
}
let popoverRef: any = null;
let popoverWidth: string = '';
let maskWidth = '';
let maskHeight = '';
let maskBorderTopWidth = '';
Expand Down Expand Up @@ -120,12 +121,12 @@
}
el.style.width = `${width}px`;
popoverWidth = `${width}px`;
el.style.height = `${height}px`;
el.style.position = 'fixed';
el.style.top = `${top}px`;
el.style.left = `${left}px`;
el.style.transform = `translate(0, 0)`;
el.style.transform = `translate(0, 0)`;
if (!mask) {
el.style.zIndex = '-9999';
}
Expand Down Expand Up @@ -252,7 +253,13 @@
style:transition={maskRootTransition}
style:z-index={zIndex}
>
<KPopover bind:this={popoverRef} trigger="manual" {placement} arrow={resolveShowArrow}>
<KPopover
bind:this={popoverRef}
trigger="manual"
width={popoverWidth}
{placement}
arrow={resolveShowArrow}
>
<div slot="contentEl" class={contentClass}>
<div class={headerCls}>
<slot name="title" current={index} title={steps[index].title}>
Expand Down

0 comments on commit d752287

Please sign in to comment.