Form Input: only setFeedback on last radio/checkbox in production mode

This commit is contained in:
cgfhtw
2024-02-19 10:39:18 +01:00
parent 70386a58f3
commit 6aebbada06
+3 -7
View File
@@ -200,13 +200,9 @@ export default {
this.valid = valid;
// NOTE(chris): On a list of radios/checkboxes only add the feedback message to the last item
if (this.name && (this.lcType == 'radio' || this.lcType == 'checkbox')) {
let n = this.$el.nextSibling;
for (; n; n = n.nextSibling)
if (n.nodeType == 1
&& n.__vueParentComponent?.ctx?.lcType == this.lcType
&& n.__vueParentComponent?.ctx?.name == this.name
)
return;
const selector = 'input[type="' + this.lcType + '"][name="' + this.name + '"]';
if ([...this.$el.parentNode.querySelectorAll(selector)].pop() != this.$refs.input)
return;
}
this.feedback = feedback;
},