FIX: improves tag-list setting (#9574)
- Prevents setting to display an empty tag - Updates dropdown when selecting/removing tag
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import Component from "@ember/component";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default Component.extend({
|
||||
@discourseComputed("value")
|
||||
selectedTags: {
|
||||
get(value) {
|
||||
return value.split("|");
|
||||
},
|
||||
set(value) {
|
||||
this.set("value", value.join("|"));
|
||||
return value;
|
||||
return value.split("|").filter(Boolean);
|
||||
}
|
||||
},
|
||||
|
||||
@action
|
||||
changeSelectedTags(tags) {
|
||||
this.set("value", tags.join("|"));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user