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

SearchChoices - Is it possible to pre populate the search string #30

Closed
ettiennelr opened this issue Feb 12, 2021 · 8 comments
Closed
Labels
enhancement New feature or request

Comments

@ettiennelr
Copy link

Hi

Is it possible to set the search string on the widget and then have it open by setting its focus?

Example:

I have a widget with an image that contained a string value. see image 1

When the user taps the image I want to automatically set the search string in SearchChoices and have the dialog open and the lookups filtered. see image 2
image1
image2

@lcuis
Copy link
Owner

lcuis commented Feb 12, 2021

Hello @ettiennelr ,

search_choices doesn't support this possibility at the moment. Sorry for the inconvenience and thanks for mentionning this potential enhancement.

@lcuis lcuis added the enhancement New feature or request label Feb 12, 2021
lcuis added a commit that referenced this issue Mar 6, 2021
…Ferraro-IRForever #31

* Added padding parameter to set the padding around the DropdownButton, thanks to @luis-cruzt #27
* Migrated buttons to non-deprecated versions
* Added the possibility to call the dialog with the search terms from a button, thanks to @ettiennelr #30
@lcuis
Copy link
Owner

lcuis commented Mar 6, 2021

Hello @ettiennelr ,

Version 2.0.0 now provides a way to solve this through the use of the new parameter setOpenDialog.
This is demonstrated in the example app as "Single dialog open and set search terms".

Can you please let me know whether I can close this request?

Cheers!

@ettiennelr
Copy link
Author

ettiennelr commented Mar 7, 2021 via email

@lcuis
Copy link
Owner

lcuis commented May 3, 2021

Closing due to inactivity. Feel free to reopen if needed.

@lcuis lcuis closed this as completed May 3, 2021
@viniciusweber
Copy link

viniciusweber commented Jun 30, 2022

@lcuis How can I make a search preselected with setOpenDialog ?

I used it to focus the element only.

My case open in showModalBottomSheet

@lcuis
Copy link
Owner

lcuis commented Jun 30, 2022

Hello @viniciusweber ,

Sorry, I'm afraid the search_choices plugin only supports dialog or menu, not showModalBottomSheet. Maybe this would be worth opening a new issue to support this alternative?

@viniciusweber
Copy link

@lcuis

Thanks for the answer,

I use SearchChoices.single() inside a showModalBottomSheet, my intention would be when opening the showModalBottomSheet again, keep the previous search written in the box equal to the topic owner

@lcuis
Copy link
Owner

lcuis commented Jun 30, 2022

Oh, sorry @viniciusweber , I misunderstood.

The best way for me to help you would be if you could open a new issue with your code example. I think this would help me understand your need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants