Skip to content

Commit 1571efc

Browse files
rzzfalex-key
authored andcommitted
fix: navigation is blocked after clicking View Source (npmx-dev#1496)
1 parent 12c2797 commit 1571efc

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

app/components/Package/SkillsModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function getWarningTooltip(skill: SkillListItem): string | undefined {
170170
aria-hidden="true"
171171
:text="getWarningTooltip(skill)"
172172
to="#skills-modal"
173+
defer
173174
>
174175
<span class="i-lucide:circle-alert w-3.5 h-3.5 text-amber-500" />
175176
</TooltipApp>

app/components/Tooltip/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const props = defineProps<{
88
interactive?: boolean
99
/** Teleport target for the tooltip content (defaults to 'body') */
1010
to?: string | HTMLElement
11+
/** Whether to defer teleport rendering until after the component is mounted */
12+
defer?: boolean
1113
/** Offset distance in pixels (default: 4) */
1214
offset?: number
1315
}>()
@@ -52,6 +54,7 @@ const tooltipAttrs = computed(() => {
5254
:position
5355
:interactive
5456
:to
57+
:defer
5558
:offset
5659
:tooltip-attr="tooltipAttrs"
5760
@mouseenter="show"

app/components/Tooltip/Base.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const props = withDefaults(
1717
tooltipAttr?: HTMLAttributes
1818
/** Teleport target for the tooltip content (defaults to 'body') */
1919
to?: string | HTMLElement
20+
/** Whether to defer teleport rendering until after the component is mounted */
21+
defer?: boolean
2022
/** Offset distance in pixels (default: 4) */
2123
offset?: number
2224
/** Strategy for the tooltip - prefer fixed for sticky containers (defaults to 'absolute') */
@@ -46,7 +48,7 @@ const { floatingStyles } = useFloating(triggerRef, tooltipRef, {
4648
<div ref="triggerRef" class="inline-flex">
4749
<slot />
4850

49-
<Teleport :to="props.to">
51+
<Teleport :to="props.to" :defer>
5052
<Transition
5153
enter-active-class="transition-opacity duration-150 motion-reduce:transition-none"
5254
leave-active-class="transition-opacity duration-100 motion-reduce:transition-none"

0 commit comments

Comments
 (0)