Metadata
- Source
- FLUID-6751
- Type
- Bug
- Priority
- Major
- Status
- Open
- Resolution
- N/A
- Assignee
- Antranig Basman
- Reporter
- Antranig Basman
- Created
2022-09-29T08:50:17.610-0400 - Updated
2022-09-29T08:50:17.610-0400 - Versions
-
- 4.4
- Fixed Versions
- N/A
- Component
-
- Framework
Description
To conditionally disable components via distributions for the UIOptions demo, I attempted a few schemes, such as
fluid.defaults("fluid.prefs.panelHolder.selfVoicingIfAvailable", {
distributeOptions: {
selfVoicingIfAvailable: {
target: "{that selfVoicing}.type",
record: "@expand:fluid.prefs.selfVoicingIfAvailable()"
}
}
});
or
fluid.defaults("fluid.prefs.panelHolder.selfVoicingIfAvailable", {
selfVoicingPanelGrade: "@expand:fluid.prefs.selfVoicingIfAvailable()",
distributeOptions: {
selfVoicingIfAvailable: {
target: "{that selfVoicing}.type",
source: "{that}.options.selfVoicingPanelGrade"
}
}
});
or perhaps
fluid.defaults("fluid.prefs.panelHolder.selfVoicingIfAvailable", {
gradeNames: ["fluid.contextAware"],
contextAwareness: {
textToSpeech: {
checks: {
supportsTTS: {
contextValue: "{fluid.supportsTTS}",
gradeNames: "fluid.prefs.panel.selfVoicing"
}
},
defaultGradeNames: "fluid.emptySubcomponent"
}
}
});
None of these succeed in disabling the component via the ancient "fluid.emptySubcomponent" scheme which is only recognised via the "type" field, which it seems is unresponsive to expanders. We should really use a modern lensed/dynamic component system.