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

sl-select shows scrollbars in menu when html margin is 0 #743

Closed
benjamind opened this issue May 3, 2022 · 4 comments
Closed

sl-select shows scrollbars in menu when html margin is 0 #743

benjamind opened this issue May 3, 2022 · 4 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@benjamind
Copy link

benjamind commented May 3, 2022

Describe the bug

It appears the sizing of the sl-menu-item within an sl-select is incorrect if the html element has no margin.

To Reproduce

Steps to reproduce the behavior:

  1. Set html style for margin to 0
  2. Use an sl-select component
  3. Open the control and observe scrollbars in the dropdown menu

Demo

https://codepen.io/delarre/pen/GRQgMKo?editors=1100

Screenshots

image

Browser / OS

  • OS: [e.g. Mac, Windows]
  • Browser [e.g. Chrome, Firefox, Safari]
  • Browser version [e.g. 22]

Additional information

Provide any additional information about the bug here.

@benjamind benjamind added the bug Things that aren't working right in the library. label May 3, 2022
@benjamind benjamind changed the title sl-select shows scrollbars in menu when html padding is 0 sl-select shows scrollbars in menu when html margin is 0 May 3, 2022
@benjamind
Copy link
Author

Further investigation reveals this also occurs if the element is absolutely positioned at the edge of a scroll container.

@claviska
Copy link
Member

claviska commented May 5, 2022

I need to investigate this further, but it could be intended, as <sl-select> uses <sl-dropdown> and the latter uses Floating UI to ensure the panel is positioned within the viewport.

@claviska
Copy link
Member

This was caused by the padding property that gets passed to Floating UI, which was set to 8 for some reason. I was able to replicate it and verify the fix.

@benjamind
Copy link
Author

Nice work thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants