-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: collection repeat still repeating the item #2804
Comments
Hi guys, this happens probably because the directives inside of the ion-item ( like ionDeleteButton ) are requiring the ionList controller, but in collection-repeat the parent is not a ion-list (but another div) so the controller is not passed to the directive. When the item is added to the collection, e.g. after scrolling, the directive can't find the controller and so it doesn't know if it's showing the options button or delete button. IonicModule
.directive('ionDeleteButton', function() {
return {
restrict: 'E',
require: ['^ionItem', '^?ionList'],
//Run before anything else, so we can move it before other directives process
//its location (eg ngIf relies on the location of the directive in the dom)
priority: Number.MAX_VALUE,
compile: function($element, $attr) {
//Add the classes we need during the compile phase, so that they stay
//even if something else like ngIf removes the element and re-addss it
$attr.$set('class', ($attr['class'] || '') + ' button icon button-icon', true);
return function($scope, $element, $attr, ctrls) {
var itemCtrl = ctrls[0];
var listCtrl = ctrls[1];
var container = jqLite(ITEM_TPL_DELETE_BUTTON);
container.append($element);
itemCtrl.$element.append(container).addClass('item-left-editable');
console.log(listCtrl);
// listCtrl is always null so the lines below are never executed
if (listCtrl && listCtrl.showDelete()) {
container.addClass('visible active');
}
};
}
};
}); |
The issue on the codepen above seems to happen only on mousewheel event. add:
after:
|
This issue is not fixed for me. even the above codepen example issue exists still. don't know how come its closed. I have created a exact example here http://codepen.io/anon/pen/LVOMEb if that helps to better understand the issue. any help would greatly help me. |
To add more details to above example. Am using a slide box with 2 slide in a collection repeat. The issue is if i make a slide 2 on any item active and scroll down, i would see the next items in list at the approx position of the item swiped would be come active. |
could this issue be re-opened or should i create new one? |
Type: bug
Platform: desktop browser
The issue is similar to below one only the difference is am using slidebox instead of delete-button and ion-option-button http://codepen.io/mhartington/pen/pnbiy
The text was updated successfully, but these errors were encountered: