Skip to content

Commit

Permalink
Dependent Picklist Defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Smith committed Jan 4, 2025
1 parent d761175 commit 8e820e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@
value={inputValues.masterLabel.value} onchange={handleValueChange}></lightning-input>
<lightning-input type="text" label={inputValues.helpText.label} name="select_helpText"
value={inputValues.helpText.value} field-level-help={inputValues.helpText.helpText} onchange={handleValueChange}></lightning-input>
<template if:false={showControllingValues}>
<!-- <template if:false={showControllingValues}> -->
<c-fsc_flow-combobox name="select_value" label={inputValues.value.label} value={inputValues.value.value}
value-type={inputValues.value.valueDataType} builder-context-filter-type="String"
builder-context-filter-collection-boolean={inputValues.value.isCollection}
builder-context={_builderContext}
onvaluechanged={handleFlowComboboxValueChange}
automatic-output-variables={automaticOutputVariables}
></c-fsc_flow-combobox>
</template>
<!-- </template> -->
<lightning-input type="number" label={inputValues.style_width.label} name="select_style_width"
value={inputValues.style_width.value} onchange={handleValueChange}></lightning-input>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
QuickChoiceMockHttpResponseGenerator
12/20/24 - Eric Smith - Version 2.45
Overrode (6/20/24 – bjvndrwalt) change with a different way to clear dependent selections when the controlling value changes - default values are now not supported for dependent picklists
Overrode (6/20/24 – bjvndrwalt) change with a different way to clear dependent selections when the controlling value changes
Default values are now supported for dependent picklists on initial load
1/16/24 - Eric Smith - Version 2.44
Implemented workaround for Spring '24 bug with dependent picklists and other reactivity issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ export default class QuickChoiceFSC extends LightningElement {
if (value != this.priorControllingValue) {
this.priorControllingValue = value;
this.setPicklistSelections(this.picklistFieldDetails);
this.clearSelectedValue();
if (this.isConnected) { // Don't clear default value of dependent picklist on initial load v2.45
this.clearSelectedValue();
}
}
}
}
Expand All @@ -130,7 +132,9 @@ export default class QuickChoiceFSC extends LightningElement {
if (value != this.priorControllingValue) {
this.priorControllingValue = value;
this.setPicklistSelections(this.picklistFieldDetails);
this.clearSelectedValue();
if (this.isConnected) { // Don't clear default value of dependent picklist on initial load v2.45
this.clearSelectedValue();
}
}
}
}
Expand Down Expand Up @@ -547,9 +551,7 @@ export default class QuickChoiceFSC extends LightningElement {
this.template.querySelector('[data-id="' + this.value + '"]').checked = true;
}
}
if (!this.showPicklist) { // v2.45 Clear current selected value if picklist is hidden
this.selectedValue = "";
}

// Output default value for reactivity
if (this._selectedValue != null) {
this.dispatchFlowAttributeChangedEvent('value', this._selectedValue);
Expand Down

0 comments on commit 8e820e1

Please sign in to comment.