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: Add MoreItemsTemplate RenderFragment. #4566
Conversation
@Garderoben I believe this is in your area. |
Actually @henon this might be more for you, what do you think of this change? |
I approve of this addition. Could be used to implement a "Show more" or "Show all" functionality. |
@henon I've made the change you requested. Should this feature have its own docs section or is its presence under the API enough? |
Codecov Report
@@ Coverage Diff @@
## dev #4566 +/- ##
==========================================
+ Coverage 91.27% 91.30% +0.03%
==========================================
Files 362 362
Lines 12481 12502 +21
==========================================
+ Hits 11392 11415 +23
+ Misses 1089 1087 -2
Continue to review full report at Codecov.
|
I believe this nifty feature deserves its own docs section. |
You are right of course. I overlooked that question from @Mr-Technician, sorry. |
I can add a docs section this evening (or at some point in the next few days at least) but I'll make a new PR since this one is already merged. |
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
* Autocomplete: Add MoreItemsTemplate RenderFragment. * Fix unit test. * Always count returned items on search.
Description
This PR adds a
<MoreItemsTemplate>
render fragment to the autocomplete. The component has a means of limiting the items displayed but provides no indication to the user that the list of items may be truncated. This PR provides a means of displaying a render fragment in the number of items returned from theSearchFunc
is greater than theMaxItems
count.For example:
My biggest caveat is the items
IEnumerable
must be enumerated twice, once to get the count of items, and once to take the appropriate number according to MaxItems. There may be a way to better optimize this (I don't care how long the itemsIEnumberable
is, provided it is longer than MaxItems).How Has This Been Tested?
I have added a unit test
Types of changes
Checklist:
dev
).