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

When dropdown is clicked, UI should not get expanded, the items should display like normal dropdown effect #40

Open
wasimakram3 opened this issue Jun 10, 2021 · 13 comments
Assignees
Labels
enhancement New feature or request waiting for customer response The team needs more information from the user

Comments

@wasimakram3
Copy link

No description provided.

@wasimakram3
Copy link
Author

For Example: If I'm having 6 dropdowns horizontally, i need to show items down the dropdown like default dropdowns. total UI should not get expanded

@lcuis
Copy link
Owner

lcuis commented Jun 10, 2021

Did you try dialogBox: false parameter as in below example?

SearchChoices.single(
        items: items,
        value: selectedValueSingleMenu,
        hint: "Select one",
        searchHint: null,
        onChanged: (value) {
          setState(() {
            selectedValueSingleMenu = value;
          });
        },
        dialogBox: false,
        isExpanded: true,
        menuConstraints: BoxConstraints.tight(Size.fromHeight(350)),
      )

@lcuis
Copy link
Owner

lcuis commented Jun 20, 2021

Closing for inactivity. Feel free to reopen if needed.

@lcuis lcuis closed this as completed Jun 20, 2021
@nhatzbulawan
Copy link

@lcuis , I think he is looking for something like the image below which is what I am looking for as well instead of expanding.
image

@lcuis
Copy link
Owner

lcuis commented Jun 26, 2021

Thanks a lot @nhatzbulawan for the explanation!

The list of selectable items must be floating in an overlay below the search bar and it must be scrollable. Probably, the list of selected items would be underneath the search bar, hidden by the overlayed selectable list.

A good lead for solution might be the use of the DropdownButton class.

If time allows, I'll try to see if something can be done about it because this would a compact display of the same features. Though, it doesn't seem easy to achieve.

@lcuis lcuis reopened this Jun 26, 2021
@lcuis lcuis added the enhancement New feature or request label Jun 26, 2021
@lcuis lcuis self-assigned this Jun 26, 2021
@nhatzbulawan
Copy link

@lcuis , Yes exactly. And one more thing, if it is possible to have an option to change the dialog to be full, max-width based or content width based
.

@lcuis
Copy link
Owner

lcuis commented Jun 26, 2021

@nhatzbulawan ,

You are still talking about the new dropdown mode I assume.

Full means full screen? This may be a bit complex with the keyboard and the search bar that need to be visible.

Max-width is wathever room is available between the search bar and the keyboard?

Content-width means that each item must be displayed with wathever width is required. This probably implies a scroll to move to the side to make the whole content visible.

I'm not sure time will allow me to do all of this. I'll see what I can do.

Thanks anyway for the details.

@nhatzbulawan
Copy link

@lcuis , I'm sorry I forgot to mention that those options are for dialog. Currently, I think, it only supports full screen. It would be best if it can adjust the width. Like for example if the options are just numbers. Using the full screen on the web is not so good as a user experience.

Anyway, thank you so much for your responses.

@lcuis
Copy link
Owner

lcuis commented Jun 26, 2021

@nhatzbulawan in that case, maybe this issue would be what you are looking for:
#38

@nhatzbulawan
Copy link

@lcuis , Yes, Thanks

lcuis added a commit that referenced this issue Jul 10, 2021
#40
problem with the overlay that doesn't scroll along with the parent page.
@lcuis
Copy link
Owner

lcuis commented Jul 10, 2021

Hello @nhatzbulawan ,

I tried for a long time to find a solution that would fulfil your requirement. I am sorry to say that this is not as easy as I initially expected.

I tried with DropdownButton, showMenu, PopupMenuButton and many other approaches. None seem acceptable. At least within this project.

The best I reached was the following:
image

I faced this issue where the overlay doesn't apply the parent theme:
flutter/flutter#39379
I believe this can be worked around.

More severely, if I scroll the page with the parent button, the overlay doesn't follow. This seems to be described in this issue:
flutter/flutter#50961

Also, the items don't scroll by themselves.

I wish my answer would be more positive. Sorry about that. Maybe this can evolve with the potential resolution of the issues mentioned or maybe this can be solved with another plugin?

I have put my attempts in the dropdown branch:
https://github.com/lcuis/search_choices/tree/dropdown

Maybe this plugin is a good starting point?
https://pub.dev/documentation/overlay_container/latest/overlay_container/OverlayContainer-class.html

lcuis added a commit that referenced this issue Jul 10, 2021
#40
problem with the overlay that doesn't scroll along with the parent page.
@nhatzbulawan
Copy link

Hello @lcuis,

Thank you so much for the effort and update. I really appreciate it a lot.

I used dropdowninputfield for options that have less than 10 items and use the modal for more than 10 items with your plugin.

@lcuis
Copy link
Owner

lcuis commented Jul 11, 2021

You’re welcome @nhatzbulawan .
I am glad you found a solution.
Thanks for your response and thanks again for the clarification of the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting for customer response The team needs more information from the user
Projects
None yet
Development

No branches or pull requests

4 participants