Skip to content

PB-1750: fix print scales going out of screen (overflow)#1381

Merged
pakb merged 5 commits intodevelopfrom
fix-PB-1750-dropdown-overflow-issue
Aug 5, 2025
Merged

PB-1750: fix print scales going out of screen (overflow)#1381
pakb merged 5 commits intodevelopfrom
fix-PB-1750-dropdown-overflow-issue

Conversation

@pakb
Copy link
Contributor

@pakb pakb commented Jul 11, 2025

refactoring the DropdownButton component to use FloatingUI, and ensuring the size of the dropdown "menu" (aka the floating thing) can't grow outside the document's height, and switch to a scroll/overflow if needed

Test link

@github-actions github-actions bot added the bug label Jul 11, 2025
@cypress
Copy link

cypress bot commented Jul 11, 2025

web-mapviewer    Run #5544

Run Properties:  status check passed Passed #5544  •  git commit 7b312a51dd: PB-1750: switch ID generation to UUID (v4)
Project web-mapviewer
Branch Review fix-PB-1750-dropdown-overflow-issue
Run status status check passed Passed #5544
Run duration 04m 33s
Commit git commit 7b312a51dd: PB-1750: switch ID generation to UUID (v4)
Committer Pascal Barth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 20
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 260
View all changes introduced in this branch ↗︎

@pakb pakb force-pushed the fix-PB-1750-dropdown-overflow-issue branch from 451428c to 0096439 Compare July 11, 2025 13:36
@pakb pakb force-pushed the fix-PB-1750-dropdown-overflow-issue branch from 6bc0b0f to 7de363b Compare August 4, 2025 07:39
refactoring the DropdownButton component to use FloatingUI, and ensuring the size of the dropdown "menu" (aka the floating thing) can't grow outside the document's height, and switch to a scroll/overflow if needed
@pakb pakb force-pushed the fix-PB-1750-dropdown-overflow-issue branch from 11f4501 to ba5886e Compare August 4, 2025 09:47
@pakb pakb requested review from ltkum, schtibe and sommerfe and removed request for sommerfe August 4, 2025 09:47
Copy link
Contributor

@schtibe schtibe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue with the dropdown: when you change the style of a marker, the popup closes when selecting a size or a symbol library

@schtibe
Copy link
Contributor

schtibe commented Aug 4, 2025

While reviewing this, I started to wonder why we even have a custom dropdown component. Currently the component doesn't support selecting entries by arrow or search by typing, which the native dropdowns do.

I presume it's either because styling is too hard or it's because the native dropdowns can't be made with just the icon 🤔

@pakb
Copy link
Contributor Author

pakb commented Aug 4, 2025

Native dropdown are a good trade-off solution, but can't be styled
And I think the idea was to have the "bootstrap" styled dropdown made in Vue with the first iteration of this component.

Don't know if we should simply let browser do the rendering or if that would bring other issues...

Copy link
Contributor

@ltkum ltkum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems mostly okay to me :)

stop the propagation of click event on items, after they are caught by the dropdown button component. This way the parent floatingUI window doesn't receive the click event, and is not closing because of it.
@schtibe
Copy link
Contributor

schtibe commented Aug 5, 2025

Native dropdown are a good trade-off solution, but can't be styled And I think the idea was to have the "bootstrap" styled dropdown made in Vue with the first iteration of this component.

Don't know if we should simply let browser do the rendering or if that would bring other issues...

I took a quick look around, and most of the UI libraries that I checked are doing it custom, too. There's also the approach of doing both for a11y, but I would think this should be possible with the correct aria- tags, too

So I vote for keeping it and maybe extend it for arrow selection, but that would be another PR entirely!

and raise up a notch the seed/upper limit for random ID on Dropdown, to reduce even more the chance to get twice the same number on subsequent uses (and have twice the same HTML ID in the app)
@pakb
Copy link
Contributor Author

pakb commented Aug 5, 2025

So I vote for keeping it and maybe extend it for arrow selection, but that would be another PR entirely!

here's the ticket for that https://swissgeoplatform.atlassian.net/browse/PB-1879 👍

@pakb pakb requested review from ltkum and schtibe August 5, 2025 07:42
Copy link
Contributor

@ltkum ltkum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It now looks good to me :)

@pakb pakb merged commit 92ce740 into develop Aug 5, 2025
6 checks passed
@pakb pakb deleted the fix-PB-1750-dropdown-overflow-issue branch August 5, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants