-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[ui.select:choices] Expected multiple .ui-select-choices-row but got '0'. #1355
Comments
I had the same error. The bug occured in safari when using the mouse only and I did a little more debugging. The problem I found was with the ng-if added to the choices itself: The ng-if seems to trigger after the _ensureHighlightVisible is called, which in turn lets the querySelector not find any elements (ng-if removed them from the DOM). After the error is triggered, the elements will be shown as usual, angular will still trigger the ng-if. I'd like to have someone else test this, too |
@lordnox Thanks for the workaround. I have been using Angular 1.5, and recently started getting the same error, as well as strange performance behavior, as if the browser was processing something and scroll was getting reset. I commented out the ng-if (added ; on line before as well).
Performance is back to normal and I do not see this error anymore. Thanks! edit: I was also using an array of 100+ items, so perhaps an ng-if on each item was causing the lock up. |
I had the same issue, @gatormike workaround worked for me as a temporary solution. |
Me too, removing the .attr('ng-if', [...]) seems to work. |
+1 @gatormike thx. |
+1 |
...at the cost of potential unnecessary watches when dropdown is closed. But the premise is that, until the resulting errors are fixed, the preference is to avoid the errors for now. Closes angular-ui#1355
...at the cost of potential unnecessary watches when dropdown is closed. But the premise is that, until the resulting errors are fixed, the preference is to avoid the errors for now. Closes angular-ui#1355
Hey, guys, I have found how to fix this issue without Forking. |
Closing as a duplicate of #224 |
For my case the source of the bug was this: if (ctrl.$animate && ctrl.$animate.on && ctrl.$animate.enabled(container[0])) {
ctrl.$animate.on('enter', container[0], function (elem, phase) {
if (phase === 'close') {
// Only focus input after the animation has finished
$timeout(function () {
ctrl.focusSearchInput(initSearchValue);
console.log('focusSearchInput()'); // Gets called hunreds of times
});
}
}); The Removing the ngAnimate module fixes the problem. |
Add the HTML: JS:
|
@lsanczyk Your solution works for me, thank you! Angular 1.5.0 |
Thanks @lsanczyk, your solutions saved my day! |
Thanks @lsanczyk Your solution works for me, thank you! Very good |
Error site found at code below
Created a silly workaround for this issue
Thanks!
The text was updated successfully, but these errors were encountered: