FIX: ensures mini-tag-chooser display min tags req if no selection (#9303)

This commit is contained in:
Joffrey JAFFEUX 2020-03-30 19:34:53 +02:00 committed by GitHub
parent a3345057f2
commit fa5ba6beb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,20 @@ export default ComboBox.extend(TagsMixin, {
);
}),
modifyNoSelection() {
if (this.selectKit.options.minimum) {
const minimum = parseInt(this.selectKit.options.minimum, 10);
if (minimum > 0) {
return this.defaultItem(
null,
I18n.t("select_kit.min_content_not_reached", { count: minimum })
);
}
}
return this._super(...arguments);
},
init() {
this._super(...arguments);