Should be able to set max no. items to display in md-autocomplete dropdown #8751
Comments
@chrismortega Sorry for the late response. I was looking at your issue right now. I have some problems understanding your expected behavior.
|
On higher resolutions an opened md-autocomplete could be much more effective if it took some advantage of the extra space it has to drop down. Currently it seems to have a max height. It would be better if I could specify a default height or num items to try to use. It would then need to determine if it has the space to use my desired height, and if not use as much as it can without being cut off. If that's still confusing please let me know. Thanks! |
I think that's reasonable. I have in mind an attribute like I will try to take a look at this functionality and also confirm with the specs. Thanks for the info :) |
That would be a dream come true, ha. Thank you! |
Oh one more clarification: if I specify md-dropdown-items="6" but I only have 3 items in the dropdown the height should shrink to show just those 3 items, rather than showing 3 items plus 3 more items with of blank of blank space. |
…ems. * Adds an attribute, which allows developer to overwrite the amount of items shown in the autocomplete dropdown. - When the dropdown doesn't fit into the possible space it will shrink accordingly (as same as before) - When the specified amount of items is higher than the current matches then it will shrink (as same as before) * Fixes the item height deviations between CSS and JavaScript. * Removed the unnecessary CSS for the dropdown height, because everything will be handled from the JS (same as before) * Added tests for the dropdown height calculation, which make sure that everything is now calculated properly. Fixes angular#9306. Closes angular#8751.
@chrismortega Perfect, I actually thought about the same :)
|
Just had a look at the code. Looks awesome, thanks! |
…ems. * Adds an attribute, which allows developer to overwrite the amount of items shown in the autocomplete dropdown. - When the dropdown doesn't fit into the possible space it will shrink accordingly (as same as before) - When the specified amount of items is higher than the current matches then it will shrink (as same as before) * Fixes the item height deviations between CSS and JavaScript. * Removed the unnecessary CSS for the dropdown height, because everything will be handled from the JS (same as before) * Added tests for the dropdown height calculation, which make sure that everything is now calculated properly. Fixes angular#9306. Closes angular#8751.
…ems. (#9307) * Adds an attribute, which allows developer to overwrite the amount of items shown in the autocomplete dropdown. - When the dropdown doesn't fit into the possible space it will shrink accordingly (as same as before) - When the specified amount of items is higher than the current matches then it will shrink (as same as before) * Fixes the item height deviations between CSS and JavaScript. * Removed the unnecessary CSS for the dropdown height, because everything will be handled from the JS (same as before) * Added tests for the dropdown height calculation, which make sure that everything is now calculated properly. Fixes #9306. Closes #8751.
…ems. (angular#9307) * Adds an attribute, which allows developer to overwrite the amount of items shown in the autocomplete dropdown. - When the dropdown doesn't fit into the possible space it will shrink accordingly (as same as before) - When the specified amount of items is higher than the current matches then it will shrink (as same as before) * Fixes the item height deviations between CSS and JavaScript. * Removed the unnecessary CSS for the dropdown height, because everything will be handled from the JS (same as before) * Added tests for the dropdown height calculation, which make sure that everything is now calculated properly. Fixes angular#9306. Closes angular#8751.
Actual behavior:
You can write some css to make the list taller, but you have to hard-code it so that if the number of entries is smaller than your hard-coded value you end up with blank space. The md-autocomplete should be updated to allow a max, but still shrink when there aren't enough items to reach that max.
CodePen or Steps to reproduce the issue: *
Angular Versions: *
Additional Information:
Shortcut to create a new CodePen Demo.
Note:
*
indicates required information. Without this information, your issue may be auto-closed.The text was updated successfully, but these errors were encountered: