Skip to content

Commit

Permalink
fix: arrow shifting content
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jan 19, 2024
1 parent d8f4199 commit b443720
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 52 deletions.
28 changes: 15 additions & 13 deletions src/lib/bits/link-preview/components/link-preview-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,21 @@
$: builder = $content;
$: Object.assign(builder, attrs);
$: updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
$: if ($open) {
updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
}
</script>

{#if asChild && $open}
Expand Down
28 changes: 15 additions & 13 deletions src/lib/bits/menu/components/menu-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@
$: builder = $menu;
$: Object.assign(builder, attrs);
$: updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
$: if ($open) {
updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
}
</script>

{#if asChild && $open}
Expand Down
28 changes: 15 additions & 13 deletions src/lib/bits/popover/components/popover-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,21 @@
$: builder = $content;
$: Object.assign(builder, attrs);
$: updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
$: if ($open) {
updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
}
</script>

{#if asChild && $open}
Expand Down
6 changes: 6 additions & 0 deletions src/lib/bits/popover/components/popover.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
open = next;
}
return next;
},
positioning: {
gutter: 0,
offset: {
mainAxis: 1
}
}
});
Expand Down
4 changes: 4 additions & 0 deletions src/lib/bits/popover/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export function setCtx(props: CreatePopoverProps) {
const getAttrs = createBitAttrs(NAME, PARTS);
const popover = {
...createPopover({
positioning: {
placement: "bottom",
gutter: 0
},
...removeUndefined(props),
forceVisible: true
}),
Expand Down
28 changes: 15 additions & 13 deletions src/lib/bits/select/components/select-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,21 @@
$: builder = $menu;
$: Object.assign(builder, attrs);
$: updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
$: if ($open) {
updatePositioning({
side,
align,
sideOffset,
alignOffset,
collisionPadding,
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport,
strategy,
overlap
});
}
</script>

<!-- svelte-ignore a11y-no-static-element-interactions / applied by melt's builder-->
Expand Down

0 comments on commit b443720

Please sign in to comment.