Skip to content

fix: LEAP-1983: [FE] Conditional View Visibility Fails When Based on a Choice Selected Within a Taxonomy Tag #7373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 25, 2025
3 changes: 1 addition & 2 deletions web/libs/editor/src/mixins/SelectedChoiceMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const SelectedChoiceMixin = types.model().views((self) => ({
if (choiceValue?.length) {
// grab the string value; for taxonomy, it's the last value in the array
const selectedValues = self.selectedValues().map((s) => (Array.isArray(s) ? s.at(-1) : s));

return choiceValue.some((value) => selectedValues.includes(value));
}

Expand All @@ -39,7 +38,7 @@ const SelectedChoiceMixin = types.model().views((self) => ({
// This is the original behaviour of other SelectedModel mixin usages
// as they are using alias lookups for choices. For now we will keep it as is since it works for all the
// other cases currently.
if (self.findLabel) {
if (self.findLabel && self.type !== "taxonomy") {
return choiceValue.map((v) => self.findLabel(v)).some((c) => c && c.sel);
}

Expand Down
Loading