Skip to content

A platform for community discussion. Free, open, simple.

FIX: prevents create row to be displayed if term is in displayed list

Joffrey JAFFEUX9b680fc45c65
diff --git a/app/assets/javascripts/select-kit/mixins/tags.js.es6 b/app/assets/javascripts/select-kit/mixins/tags.js.es6
index 8d2b2da3b65..ab5003616f1 100644
--- a/app/assets/javascripts/select-kit/mixins/tags.js.es6
+++ b/app/assets/javascripts/select-kit/mixins/tags.js.es6
@@ -1,4 +1,4 @@
-const { run } = Ember;
+const { run, get } = Ember;
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
@@ -47,6 +47,10 @@ export default Ember.Mixin.create({
return false;
}
+ if (this.get("asyncContent").map(c => get(c, "id")).includes(term)) {
+ return false;
+ }
+
return true;
},
});