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

Autocomplete NotFound item template #4668

Closed
1 of 2 tasks
Geccoka opened this issue May 24, 2022 · 3 comments · Fixed by #4692
Closed
1 of 2 tasks

Autocomplete NotFound item template #4668

Geccoka opened this issue May 24, 2022 · 3 comments · Fixed by #4692
Labels
enhancement New feature or request

Comments

@Geccoka
Copy link
Contributor

Geccoka commented May 24, 2022

Feature request type

Enhance component

Component name

MudAutocomplete

Is your feature request related to a problem?

Right now if i want to display for a given search term that there are no search results i have to return a list with one special item from the search function. Then i have to make sure that the item disabled function returns true for this special item, so it cannot be selected. This is a workaround for the problem, but then i have to extend every autocomplete's search function with the logic and set the disabled item functions.

Describe the solution you'd like

I'd like to have an item template for the case that the search function returns no results. In this case the dropdown should be opened and inside it the item template should be visible.

Have you seen this feature anywhere else?

No response

Describe alternatives you've considered

No response

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Geccoka Geccoka added enhancement New feature or request triage labels May 24, 2022
@Mr-Technician
Copy link
Member

This has been implemented here: #4566

@Geccoka
Copy link
Contributor Author

Geccoka commented Jun 1, 2022

@Mr-Technician : that PR is about MoreItemsTemplate but i need a NotFoundTemplate. I see in the changed code it is almost the same what i need, but there is a condition in the razor file which prevents the use case for emptry results (_itemsReturned > MaxItems). As you are the author of that PR could you also implement this new use case?

@Mr-Technician
Copy link
Member

Oh you're right, I read this PR just a bit too quickly! Yes, I need to add docs for #4566 anyway and could add the necessary condition for a NotFoundTemplate fairly quickly. The hardest part is the unit tests. 😆

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

Successfully merging a pull request may close this issue.

2 participants