Start a conversation

Lookup Dropdown Shows Duplicate Results on First Click

Symptom

When clicking on a Lookup attribute dropdown in the Solution Console, duplicate records appear in the results list on the first click. The duplicates disappear on subsequent clicks (close and reopen the dropdown). The browser console may show a React warning: Warning: Encountered two children with the same key.

In some cases, infinite scrolling may also occur (pagination not stopping correctly).

Cause

This is a known defect caused by a race condition in the fetchData function within the Lookup component. When the dropdown opens, two rapid API calls can both pass the in-flight request deduplication check before either stores its promise, causing duplicate results to be returned and rendered.

A secondary issue involved module-level returnedRecordKeys state being shared between multiple lookup components on the same page, causing interference.

Resolution

Install the patch release

Install the patched Solution Management package for your release:

Release Version Install Link
R36-MR1 cssmgnt 36.14.13 /packaging/installPackage.apexp?p0=04tJ5000000LSv2
R37 cssmgnt 37.4.19 /packaging/installPackage.apexp?p0=04tJ50000008thb
R38 cssmgnt 38.0.3 /packaging/installPackage.apexp?p0=04tJ50000000X2V

Verify the fix

After installing, open a basket in the Solution Console, click on a Lookup attribute dropdown, and verify that no duplicate records appear on the first click.

Additional Notes

  • This fix implements a deferred promise pattern to ensure API requests are properly deduplicated, and moves lookup state from module scope to component scope to prevent interference between multiple lookups on the same page
  • The fix has been verified across non-paginated APIs, paginated APIs, and multiple lookups on the same page
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments