This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(autocomplete): Use virtual repeat...
...and some other optimizations Closes #3733.
- Loading branch information
1 parent
391cff5
commit f817193
Showing
12 changed files
with
141 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
md-virtual-repeat-container
is not being removed after an item has been selected.f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also appears to have caused some other issues with the chips autocomplete (which is used for the Contact Chips example).
Basically, the content doesn't look like it's being bound properly because the virtual repeat appears and you can scroll through and select one, but the email/picture is not appearing (in the dom or visually).
I will open an issue and reference this commit.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md-highlight-text does not work anymore on md-item-template
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@topherfangio We have a custom chip directive that works much like the contact chips and they also render empty in the list, so I can confirm that behaviour. The demo of the contact chips also confirms this issue. Hope a fix is in the making soon.
Did you open an issue that I missed?
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houmark I didn't make an issue yet, however, I have pushed a branch which has a "fix" for it. It seems that the virtual repeat contents aren't compiled against the proper scope: https://github.com/angular/material/compare/fix-chips-autocomplete-virtual
However, this uses a
scope.$parent.$parent.$parent
reference which is a pretty bad practice, so I'm trying to find a better workaround/fix before submitting a PR.f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been testing this out but was unable to make it work with our directive that uses a mix of chips and autocomplete. It might be in our end though, as I also noticed that this also happens in the a normal input field with autocomplete but also in the demos right now so this should probably have some attention before 0.11 is out.
Any news in your end @topherfangio ?
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By testing I mean I used your branch to see how that changed things.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houmark We've been closing out some other issues, so I have not had a chance to get back to this. Were you able to get it working on your end?
For reference, my branch only fixes it for the contact chips demo, so if you are using the autocomplete inside the chips, you may run into the exact same issue and have to do something similar for the time being.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this gets fixed in v.0.11 because currently 0.11 is unusable because of this :(
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah me too, and @topherfangio we were unable to make it work with our directives so I'm eager to see any generic fixes so we can test if this is compatible with our code (which works without issues with 0.10.1).
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be one of the major bugs in 0.11.0 and I'm quite surprised to see this one slip through and 0.11.0 being released with a pretty serious bug in one of the major components. Oh well, beta we say :)
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houmark @gpopovic I have a PR which fixes this on the demo site. Any chance you could test it to see if it resolves your issues as well?
Edit: PR is here: #4391
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sure will, hopefully later today! I had missed that PR as well.
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houmark Awesome, thanks! Please make sure to ping me when you respond. I sometimes miss e-mails, but I really want to hear your feedback on this one :-)
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@topherfangio Yeah, sorry for that. I forgot to mention you on the last one. I really hope I get to this one today, but since been a few weeks since I tested the last time with HEAD, I might hit other blockers overall before I can get to this one so...
f817193
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@topherfangio I can confirm this is working with a normal use case for us (with a more or less standard auto complete dropdown that is broken on 0.11), but our custom chips with autocomplete combo is still not working and I'm not completely sure why right now, but I will keep debugging on that one and figure out a workaround. Your PR should definitely go in as it's a major improvement and fixes normal use cases.
I'll update you more if/when I figure it out but please push to get this one in :)
Nice work!