-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
+1 |
would be great if this could be merged, any updates? |
bump |
bump, without this fix sortable option not useful |
Although exists a workaround #974 (comment) when we have more than one ui-select we can't use uiSelectSort:change event since we don't know which ui-select has triggered event. |
Remove changes to |
Hi @wesleycho sorry I have no idea how to do what you just said. I've reset to the previous commit (without changes to dist) and force pushed. Hopefully this works? |
@@ -92,6 +92,8 @@ uis.directive('uiSelectSort', ['$timeout', 'uiSelectConfig', 'uiSelectMinErr', f | |||
} | |||
|
|||
move.apply(theList, [droppedItemIndex, newIndex]); | |||
|
|||
scope.$parent.$selectMultiple.updateModel(); |
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.
Instead of going through $parent
can't we require: ['^uiSelect', '?^uiSelectMultiple']
and access via a ctrls[]
param?
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've just tried this and the 2nd controller is undefined
? I'm not quite sure what to try...
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 think you can require ^ngModel and not ^uiSelectMultiple and call ngModel.$setViewValue(Date.now());
Is it not the only useful thing that updateModel does here? Everything else seems like overhead in this function for what you are trying to achieve.
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 tried this and it is working fine :
require: ['^^uiSelect', '^ngModel'],
link: function(scope, element, attrs, ctrls) {
var $select = ctrls[0];
var $ngModel = ctrls[1];
// ...
$ngModel.$setViewValue(Date.now());
// ...
}
@user378230 updated with @qraynaud 's suggestions - can confirm it works |
@homerjam : you have conflicts to fix, hope it will me merged (& released) soon. I need this working too 👍 |
@homerjam This LGTM 👍 Will merge once conflicts resolved. |
… patch-2 # Conflicts: # src/uiSelectSortDirective.js
… binding as it is." This reverts commit 9510eb1.
Sorry guys I have no idea what I'm doing, literally. Will this do? |
@homerjam : you removed the double |
Nuts. Ok. What does that do?
|
@homerjam can you confirm that the fix works with the change back to This needs a squash to a single commit but I can do that as part of the merge. (See https://help.github.com/articles/about-git-rebase/#further-reading if you want to have a go yourself) |
Hi @user378230 I can confirm that it works and have since read up on the I've tried doing the rebase several times but I keep getting conflicts and going round in circles 😞 . Thanks for the link but in this case please can you take over in the interest of getting this done! Thanks |
No description provided.