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

Add DropDown widget #205

Closed
hydra opened this issue Nov 14, 2024 · 4 comments
Closed

Add DropDown widget #205

hydra opened this issue Nov 14, 2024 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@hydra
Copy link
Contributor

hydra commented Nov 14, 2024

This is a much-needed widget. in HTML this is a 'Select' with 'Option's.

For the value type, an implementation should use a Dynamic<Option<T>> or something, not just a Dynamic<T> so that it's possible to display a drop-down widget where no selection has been made.

Examples: https://www.google.com/search?&q=dropdown&udm=2

#153 (ComboBox) mentioins ListBox but I couldn't find any implementation of DropDown or ListBox in Cushy right now.

In my example I had to use a set of Radio buttons instead, which wasn't ideal and doesn't scale where there is a reasonable number of items to choose from.

@ecton
Copy link
Member

ecton commented Nov 15, 2024

This widget was already requested in #154. I agree it's an incredibly important widget.

@ecton ecton closed this as completed Nov 15, 2024
@ecton ecton added the duplicate This issue or pull request already exists label Nov 15, 2024
@hydra
Copy link
Contributor Author

hydra commented Nov 21, 2024

Oops, sorry for the duplicate issue. Somehow I didn't spot that one, probably due to it's title of 'PopupButton' which is an unusual name for it.

@ecton
Copy link
Member

ecton commented Nov 21, 2024

unusual name for it.

It's not really unusual. Dropdown makes less sense, given that the menu doesn't always drop down. The menu that appears always is "above" or "up" from the thing that shows it regardless of the menu positioning, so the pop-up terminology fits better. Additionally, Qt, Mac, and iOS all use this term to describe this widget, and WPF on Windows doesn't offer this type of widget (ComboBox serves this purpose in that framework).

From my initial research when creating the issue originally, popup button seemed like the better name. I made the mistake of not mentioning what it was also called in other frameworks when creating the issue. Sorry for the wasted time!

@hydra
Copy link
Contributor Author

hydra commented Nov 27, 2024

Good point regarding the positioning of the menu that appears when clicked. I guess I'm remembering frameworks where the menu does always appear below the control where the name would make more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants