-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Tagging mode broken in latest release #1693
Comments
+1 Have the same issue.Occurs when new tag is created and then you start typing the same tag again. |
+1 Have the same issue. |
+1 can confirm, same issue here. |
Thanks for the report, we have a reproduction scenario now so we need a PR rather than +1's 😃 |
When I remove the I tracked it down to the This is not a fix but maybe someone else can use this as a lead... I'm not familiar with the code. |
@akempes That's exactly what we needed! Thanks! Here is an updated plunkr http://plnkr.co/edit/VmiHZuyebEUc5JcHayF5?p=preview Adding a check if its a tag appears to have resolved it. ctrl.isDisabled = function(itemScope) {
...
if (itemIndex >= 0 && (!angular.isUndefined(ctrl.disableChoiceExpression) || ctrl.multiple)) {
item = ctrl.items[itemIndex];
if(item.isTag) return false;
isDisabled = !!(itemScope.$eval(ctrl.disableChoiceExpression)) || _isItemSelected(item); // force the boolean value
item._uiSelectChoiceDisabled = isDisabled; // store this for later reference
}
...
}; Can I get confirmation this works for people? |
@user378230 It's working for me! Thanks!! I just hadn't got the time to really dive into this problem... |
@user378230 not working |
@giovanibarili are you using the updated version in my plunkr? (Not sure how you are running localhost, maybe you didn't update your local version) It appears to work for @akempes... |
@user378230, no, i'm tested in my application. At real, my problem is occur when selected an item and digit any words. |
@giovanibarili you did not use my updated plunkr to test then? I updated my plunkr only... 😕 |
Resolves issue where isDisabled was running for tags and causing a infite loop to occur if the new tag value included a previous value. For example: tag1: "a" tag2: "aa" Fixes angular-ui#1693
In ui-select v0.18.0 the Tagging mode is broken and causes more than 10 digest loops.
Steps to reproduce with plnkr:
http://plnkr.co/edit/SNOI0DmFDAah2AvwHseY?p=preview
"a"
<Enter>
"aa"
VM3851 angular.js:13236 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [[{"msg":"{active: $select.isActive(this), disabled: $select.isDisabled(this)}","newVal":{"active":true,"disabled":true},"oldVal":{"active":true,"disabled":false}}],[{"msg":"{active: $select.isActive(this), disabled: $select.isDisabled(this)}","newVal":{"active":true,"disabled":false},"oldVal":{"active":true,"disabled":true}}],[{"msg":"{active: $select.isActive(this), disabled: $select.isDisabled(this)}","newVal":{"active":true,"disabled":true},"oldVal":{"active":true,"disabled":false}}],[{"msg":"{active: $select.isActive(this), disabled: $select.isDisabled(this)}","newVal":{"active":true,"disabled":false},"oldVal":{"active":true,"disabled":true}}],[{"msg":"{active: $select.isActive(this), disabled: $select.isDisabled(this)}","newVal":{"active":true,"disabled":true},"oldVal":{"active":true,"disabled":false}}]]
This scenario is working with the officials samples with version v0.16.1 and within
http://plnkr.co/edit/Wa5BP8pkhH03EF0dzgrs?p=preview also with v0.16.1
The text was updated successfully, but these errors were encountered: