Skip to content
Snippets Groups Projects
Commit ef02fe30 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

filter conditionnal extraForms array type if some value found instead of exact match

parent bf54a30e
No related branches found
No related tags found
1 merge request!667REDMINE_ISSUE-18259 | Non-affichage du champ conditionnel avec la liste à choix multiples
......@@ -203,8 +203,12 @@ export function isXtraFormActive(extraForms, config) { // return true if no conf
// get the customForm which activates conditional field
const conditioningXForm = extraForms.find((xForm) => xForm.name === conditionField);
// check if its value match the condition value
if (conditioningXForm) { // use JSON.stringify() to compare arrays (works with other field type too)
return JSON.stringify(conditioningXForm.value) === JSON.stringify(conditionValue);
if (conditioningXForm) {
if (Array.isArray(conditionValue) && conditioningXForm.value) {
return conditioningXForm.value.some((value) => conditionValue.includes(value));
} else {
return conditioningXForm.value === conditionValue;
}
}
}
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment