Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopoverContent collisionPadding type definition #609

Closed
roycrippen4 opened this issue Jul 15, 2024 · 1 comment · May be fixed by #469
Closed

PopoverContent collisionPadding type definition #609

roycrippen4 opened this issue Jul 15, 2024 · 1 comment · May be fixed by #469
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.

Comments

@roycrippen4
Copy link

Describe the bug

The collisionPadding prop for the PopoverContent component works perfectly with the floating-ui Padding type definition.

type Padding =
  | number
  | Partial<{
      top: number;
      right: number;
      bottom: number;
      left: number;
    }>;

Specifically, the Partial<{ top: number; right: number; bottom: number; left: number; }>; works, even though the collisionPadding type definition states it only accepts a number.

This is not a bad thing. In fact, I'm super thankful I tried using the Partial despite the lsp telling me it wouldn't work. It perfectly solved a problem at my work.

I wanted to bring it to your attention because it's undocumented, potentially undesired behavior (though I would be saddened if this was removed).

Reproduction

https://stackblitz.com/edit/github-f82ovy?file=src%2Froutes%2F%2Bpage.svelte

Logs

No response

System Info

System:
  OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
  Memory: 23.44 GB / 31.27 GB
  Container: Yes   Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 21.6.2 - ~/.nvm/versions/node/v21.6.2/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v21.6.2/bin/npm
    pnpm: 8.15.7 - ~/.local/share/pnpm/pnpm
    bun: 1.1.17 - ~/.bun/bin/bun
Browsers:
  Chrome: 126.0.6478.126
npmPackages:
  @sveltejs/kit: ^2.5.18 => 2.5.18 
  bits-ui: ^0.21.12 => 0.21.12 
  svelte: ^4.2.18 => 4.2.18

Severity

annoyance

@huntabyte huntabyte added the Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5. label Jul 27, 2024
This was referenced Jul 27, 2024
@huntabyte
Copy link
Owner

Closed as fixed in bits-ui@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Svelte 5 Roadmap This issue is planned to be addressed or fixed when the library migrates to Svelte 5.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants