Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
82 stars 9 forks source link

ResourcePicker not calling onSelection #285

Open lukecharle opened 4 months ago

lukecharle commented 4 months ago

Describe the bug

I'm using the following component:

 <ResourcePicker
  resourceType="Product"
  showVariants={false}
  open={showResourcePicker}
  onSelection={(selectPayload) => {
    console.log('selectPayload => ', selectPayload);
  }}
  onCancel={() => setShowResourcePicker(false)}
  initialSelectionIds={selectedProduct ? [{ id: selectedProduct.id }] : []}
/>

The issue is upon clicking Add (after selecting a product), the onSelection callback is not working, the console log does not run, nothing runs inside of this.

Expected behaviour

Code inside onSelection to run`

Contextual information

Packages and versions

List the relevant packages you’re using, and their versions. For example: