-
Notifications
You must be signed in to change notification settings - Fork 84
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
Values not being removed or added correctly #118
Comments
Thanks for flagging this. If you need anything from me to help this along let me know. This bug is affecting a bit site at the moment, so keen to get it fixed! Thanks. |
@shornuk thanks for bringing up the bug. I'll fix it ASAP. |
++++++1 |
Just noted that this is still an issue. This happens when there's a starting selected value, and only on multiple mode. I didn't read the source enough to understand why, but upon initialization, the library seems to be loading the original value correctly to I found a quick fix for it, which is basically block a duplicate insertion to the push: function (val, index) {
var current = _this.fvalue.get();
// ===== NEW CODE =====
if (current.includes(val)) {
return;
}
// ====================
val = _this.fvalue.toObj(val);
current.push(val);
val = _this.fvalue.toStr(current);
_this.value = val;
}, As I said, this is probably just a quick fix, and ideally the root of the problem (finding out why it's trying to duplicate the entries) should be found as well. I will be opening a PR with this fix, as I think validating for duplicate entries is also important and should be done regardless. |
@roooodcastro if option "allowDuplicateValues" is set to true you would filter duplicate entries that are wanted in my opinion. I think the following code would be correct. With allowDuplicateValues set to true the bug will still be there :-(
|
2019 bump |
Fixed value duplication bug (#118) for multiple mode
Opening as a new issue as this doesn't seem to be fixed. Thought it might have been our set up that was interfering but we've stripped everything back to the simplest of test cases. Using the following...
If I select PHP and hit save, it saves the PHP string. All good. If I then select another option, for example Swift, The value gets updated as PHP,PHP,Swift so it's adding the initial value again.
In addition to this, removing any of these values does nothing.
Using version 2.2.2.
The text was updated successfully, but these errors were encountered: