Skip to content

[dropdown] resizable scrolling dropdown has empty space #3263

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

Open
GammaGames opened this issue May 6, 2025 · 3 comments
Open

[dropdown] resizable scrolling dropdown has empty space #3263

GammaGames opened this issue May 6, 2025 · 3 comments
Labels
state/awaiting-investigation Anything which needs more investigation type/feat Any feature requests or improvements

Comments

@GammaGames
Copy link
Contributor

Bug Report

Datatables recently updated its fomantic extension to use a scrolling dropdown for colvis dropdowns: DataTables/Buttons#211

It works great, but there's a bunch of padding at the bottom of the list. I'm opening the issue here since it feels more appropriate

Steps to reproduce

  1. Create a resizable scrolling dropdown with only a few values
  2. Dropdown is long with empty space

Expected result

Image

Actual result

Image

Testcase

https://jsfiddle.net/ek947zLr/

Removing these two rules fixes it, but I don't know how that affects everything else:
Image

Version

2.9.4

@GammaGames GammaGames added type/bug Any issue which is a bug or PR which fixes a bug state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels May 6, 2025
@ko2in ko2in added type/feat Any feature requests or improvements and removed type/bug Any issue which is a bug or PR which fixes a bug state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels May 12, 2025
@ko2in
Copy link
Member

ko2in commented May 12, 2025

@GammaGames It doesn't look a bug to me. The re-sizable dropdown explicitly set the height which shows some reason for doing that. The dropdown is the most complicated component in dealing with CSS.

If we change this behavior, we have to test the complete list of using the dropdown in different ways.

@lubber-de
Copy link
Member

lubber-de commented May 15, 2025

Tricky: The resizable variant removes any min/max height to allow for any manually resized height.
If we remove the initial height here, it only works in your situation: The amount of entries is less than the given height. But, if the dropdown items would be around 50 or more entries (so it makes sense to have the menu scrolling) the initial height would show the whole 50 entries, which most probably isnt desired and will make the menu go off canvas.
Without Javascript involved this isnt fetchable via pure css as we would need to detect how many entries in comparison to the given height are displayed and then remove the height as an inline style.
This however, as @ko2in said, needs to cover many more possible situations (think of dynamic amount of entries supping api load, adding entries, redraw the menu, etc...
So, if you know you only have a few entries, you might just remove the resizable class from within your application logic

@GammaGames
Copy link
Contributor Author

That makes sense, thank you! Probably best to leave it as is, thanks for the information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/awaiting-investigation Anything which needs more investigation type/feat Any feature requests or improvements
Projects
None yet
Development

No branches or pull requests

3 participants