*QuickLookup* - _(QuickLightningLookupHelper.js)_ - Conditionally hidden child lookup is not receiving parent value for WHERE clause
After setting up a parent and child lookup, if you add conditional visibility to the child lookup component so it only displays when there is a value in the parent component, that child component is not receiving the value selected in the parent component for use in the WHERE clause. I suspected this was a timing issue - the child component needs to render first before the event that sets the filter values executes. I was able to remedy by setting a 10ms delay on the fireSaveFilter function, but wanted to post here to see if there is a more elegant solution.
Steps to reproduce
Steps to reproduce the behavior:
- Set up a quickLookup component as the parent
- Set up a quickLookup component as the child (in a way that behaves like a dependent lookup field relying on the value of the parent)
- Set conditional visibility on the child component so it renders when [parent component].selectedValue Is Null False
- Run the flow and select a value for the parent quickLookup
- Focus on the child quickLookup input to open the list of records
Expected behaviour
The value from the parent component is included in the WHERE clause
Actual behaviour
The value from the parent component is not included in the WHERE clause
Screenshots
Using quickLookup v1.1 (before 10ms delay is introduced)

After 10ms delay is introduced

Potential Solution
Add a 10ms delay to fireSaveFilter in QuickLightningLookupHelper.js
fireSaveFilter : function(component, recordId){
console.log('EVENT: QuickEvtFilterValue');
var ev = $A.get('e.c:QuickEvtFilterValue');
console.log(ev);
console.log(component.get('v.cmpId'));
// var ev = component.get("e.filtervalue");
ev.setParams({
'MasterFilterValue' : recordId,
'parent': component.get('v.cmpId')
});
setTimeout(() => {
ev.fire();
}, 10)
},
If you feel this is the best solution, I can submit a PR with this change.
I like this fix. Please submit a PR.
Evan! Long time! I hope you're doing well. Great, smart fix.