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-dropdown> cannot keep content in viewport (regression in 2.0.0-beta.81) #860

Closed
CetinSert opened this issue Aug 17, 2022 · 3 comments
Closed
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@CetinSert
Copy link

CetinSert commented Aug 17, 2022

Describe the bug

In version .81, <sl-dropdown> cannot keep its content in viewport. This is a regression.

One example is described here with a playground link and screenshots.
Another example is described in the next comment with a playground link and a video.

To Reproduce

Steps to reproduce the behavior:

  1. Go to this sync: //rt.ht/⋯ 👈🏻
    Sync has versions selected for step 3 😉!
  2. See ❌ .81
  3. Press
  4. See ✔️ .80

Demo

Demo is linked at step 1 above! Just open the link and press once! Simple as it gets.

Screenshots

⚠️ Also added a 👉🏻 video you can play right on this GitHub issue page! 👈🏻 ⚠️

.81 ✔️ .80
image image

Browser / OS

  • OS: all
  • Browser: all
  • Browser version: all

Additional information

@CetinSert CetinSert added the bug Things that aren't working right in the library. label Aug 17, 2022
@CetinSert CetinSert changed the title <sl-dropdown> cannot push its content into viewport if its trigger is outside viewport (regression in 2.0.0-beta.81) <sl-dropdown> cannot push content into viewport if trigger is outside viewport (regression in 2.0.0-beta.81) Aug 17, 2022
@CetinSert
Copy link
Author

CetinSert commented Aug 18, 2022

@claviska – Here is a vertical example with video capture you can play right on this GitHub issue page!

Please note that here, unlike above, the trigger is entirely in the viewport.

  1. Go to this sync: //rt.ht/⋯ 👈🏻
  2. Adjust viewport height with mouse or keyboard
  3. Adjust library version with / keys

Here is a video capture that plays right on GitHub! Just click/tap on it 👇🏻

Sync.SL.860.and.32.more.pages.-.Personal.-.Microsoft.Edge.2022-08-18.21-10-03_Trim.mp4

@CetinSert CetinSert changed the title <sl-dropdown> cannot push content into viewport if trigger is outside viewport (regression in 2.0.0-beta.81) <sl-dropdown> cannot keep content in viewport due to a regression in 2.0.0-beta.81 Aug 18, 2022
@CetinSert CetinSert changed the title <sl-dropdown> cannot keep content in viewport due to a regression in 2.0.0-beta.81 <sl-dropdown> cannot keep content in viewport (regression in 2.0.0-beta.81) Aug 18, 2022
@CetinSert
Copy link
Author

CetinSert commented Aug 18, 2022

Temporarily worked around with <sl-popup>.autoSize = false because all of my <sl-dropdown>s are contained in the header which makes it possible use a single rule (sl-dropdown::part(panel) { max-height: ⋯ }) with a trivial calculation.

I have to say all this is really only possible and easy because of how well-designed Shoelace is! It truly is a gem of a library that shines bright among many that don't even grasp the power of web components, yet alone know what to do with the tech. 👟💎💖!


Still looking forward to a solution on this one that works for everyone though : )

@claviska
Copy link
Member

Replicated and fixed in 1996037. The auto-size attribute was resizing both horizontally and vertically. This is now configurable in <sl-popup> and set to vertical in <sl-dropdown>, which restores the previous and desired behavior.

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