mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 07:22:17 +00:00
Form Input: only setFeedback on last radio/checkbox in production mode
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user