Shopify / shopify-app-bridge

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

ResourcePicker selection behaviour breaks when limiting allowable selection (selectMultiple={XY}) #353

Open mmassaros opened 1 month ago

mmassaros commented 1 month ago

Describe the bug

When we declare the ResourcePicker limiting the allowable selected elements, by setting the options.selectMultiple to a random number (for example 2), the selection behaves inconsistently.

So we end up even after closing the Resource Picker to not be able to make a different selection upon reopening it.

To Reproduce

Steps to reproduce the behaviour:

Use ResourcePicker (we use @shopify/app-bridge 3.7.10). We normally use it with the @shopify/app-bridge-react 3.7.10 but also as standalone code it causes problems within our app.

const openProductSelect = () => {
    const picker = ResourcePicker.create(app, {
      resourceType: ResourcePicker.ResourceType.Product,
      options: {
        selectMultiple: 2
      }
    });
    picker.dispatch(ResourcePicker.Action.OPEN);
  };

Screenshot 2024-05-21 at 00 22 07

https://www.loom.com/share/f5f45b2455174dc7b7890d2ba0223e4b?sid=b271c0b1-0b9c-4185-ac8e-1a890d74129e https://www.loom.com/share/81065ad080524c0bb3a790d4c24ff8ef?sid=78a83e35-c3a6-4d4c-ae42-52d049ddfcb9

Expected behaviour

We would expect that the ResourcePicker works as in the past. It appears that when we set this variable the behaviour of selection breaks.

Contextual information

Packages and versions

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

Platform

Additional context

We tried also other app-bridge 3.X.X versions, and its broken on various OS.