Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-chips + autocomplete (list length) #5673

Closed
andrew-cunliffe opened this issue Nov 11, 2015 · 3 comments
Closed

md-chips + autocomplete (list length) #5673

andrew-cunliffe opened this issue Nov 11, 2015 · 3 comments

Comments

@andrew-cunliffe
Copy link

When using the autocomplete with md-chips there seems to be an issue with the number of displayed items...

Here is my code

HTML

<md-chips ng-model="template.validTimezones"
        md-autocomplete-snap
        md-require-match="true">
    <md-autocomplete md-selected-item="timezoneSelection"
            md-search-text="timezoneSearch"
            md-items="timezone in template.getTimezones(timezoneSearch)"
            md-item-text="timezone.id"
            placeholder="Optional time zone(s)">
        <span>{{ timezone.id }}</span>
        <md-not-found>No time zones "{{ timezoneSearch }}" were found.</md-not-found>
    </md-autocomplete>
    <md-chip-template>
        <span>{{ $chip.id }}</span>
    </md-chip-template>
</md-chips>

and the timezone search function

var getTimezones = function (search) {
    var regex = new RegExp(search, 'i'), results = [];
    angular.forEach(self.timezoneList, function(timezone) {
        if(regex.test(timezone.id)) {
            results.push(timezone);
        }
    });
    return results;
};

Screenshot of the output

screen shot 2015-11-11 at 15 24 15

However there are 4 results that should be showing, and the height of the container looks like it should be able to hold more like 5 entries.

I am not sure where the root cause is, perhaps with the virtual repeater that is trying to auto-size? But the ng-repeat inside the virtual container is only performing 3 repeats from the 4 entries, screenshot of the dom incase it helps...

screen shot 2015-11-11 at 15 27 01

Note: This is with 1.0.0-rc3

@hillerstorm
Copy link

duplicate of #5606, #5611 and #5630

@gabguy
Copy link

gabguy commented Nov 17, 2015

+1

@andrew-cunliffe
Copy link
Author

This appears to be working fine in rc4 again, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants