-
Notifications
You must be signed in to change notification settings - Fork 417
FluentAutoComplete: Allow the ability to trigger the search options via code. #3570
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
base: dev
Are you sure you want to change the base?
FluentAutoComplete: Allow the ability to trigger the search options via code. #3570
Conversation
…earch options manually.
I don't really understand why you need to trigger a search via the code. It's a user component where it's the user who should initiate the search process. In your code, you split the |
@dvoituron - Thanks for taking a look. I can see why you might not understand the need to trigger this manually. The test I provided was not really indicative of the real-world example that I need it for. Here is an image of the real-world problem that I am trying to solve: BTW - I already branched the code and have this running locally with the example above and it seems to be working without any issues. Regarding your concern about the splitting of the method: I will look at this again, but this seemed like the best place to split it based on my use-case. The existing functionality should not be impacted at all by this change since it follows the exact same path as before. If there is any risk, it would just be by those invoking this method manually. I will get back to you on my thoughts regarding where I split the method. |
I don't think you should actually do a search if a value is selected from the first dropdown. Filtering and/or limiting the list of options available to the AutoComplete based on that choice seems logical but displaying the whole list of possible options then immediately does not. To me the logical step would be to set focus to the Autocomplete and then let the user initiate the interaction (as Denis already said) |
@vnbaaij - The combobox is in the header template of the autocomplete dropdown. I have attached a video demonstrating the desired behavior. When the user starts searching for an item, the autocomplete opens and the combobox is available. Once they change say from 'Accounts' to 'Contacts', you notice that the items are refreshed. This is when I am calling the new |
@dvoituron - I thought more on your comment regarding the splitting of the
That being said, that is the desired outcome. IMO - the Stepping back from my particular use-case, is there any reason either from a technical perspective or from an API perspective that this type of functionality should not be allowed? I feel like this could be loosely compared to the |
Steven (@StevenRasmussen) I combined two of your responses here to (hopefully) clarify why we are reponding as we are. (hint: it is not because we like giving you a hard time 😁. On the contrary, we welcome your contributions very much!) The first part of your response highlights perfectly fine what your use case is. I understand why you therefore want to have the functionality change you proposed. I (still) think there are different/other ways that you could solve this UI issue but that doesn't really matter in this context.. That brings us to the second part...We need (and want) to try to guard against making every component in the library work for every situation developers come up with. It remains very hard to determine what a small change in one part of a component can mean for another part of that same component or even in another component (that might make use of it). We just don't have the bandwidth to manage all of that, in spite of all the unit tests we already have in place. So it is not that we have technical or API blockers per se. We just need to be careful and thoughtful about the changes we do make. But as you say, the change here is quite simple. We can take this in as 'low hanging fruit' once the docs cover and explain the situation that can arise with the |
…d for clarification that the search uses the 'ValueText' when performing the search. Moved the debounce code to run only on the 'InputHandlerAsync' method. The 'InvokeOptionsSearchAsync' runs immediately now.
…venRasmussen/fluentui-blazor into auto-complete-manual-refresh
@vnbaaij - Thanks for your response. I can certainly appreciate your situation with trying to maintain this library with limited resources and certainly you should try to guard against trying to support every scenario and only accept changes that improve the library more broadly for everyone. I feel this is one of those types of changes... and certainly that is always up for debate ;) I have updated the comments on the new method to better explain that it uses the |
@vnbaaij - Checking in to see if you required any additional changes on this PR. Thanks! |
Pull Request
📖 Description
I have the need to be able to trigger the auto complete to perform the search operation in code. This refactors the code and exposes a new method called
InvokeOptionsSearchAsync
. Feel free to suggest a better name as I'm not completely sold on it.✅ Checklist
General
Component-specific