App Bridge - ResourcePicker - InitialQuery not hidden on subsequent requests

Highlighted
Shopify Partner
72 0 13

When using the ResourcePicker component from AppBridge the initial query is hidden when a resource picker is displayed the first time. This is the expected results.

 

On subsequent open actions however, the initial query is visible. This seems incorrect.

 

The behavior on subsequent open actions is not a desirable outcome for two reasons: 

- the outcome is not consistent when comparing first and subsequent opens

- the initial query should not be visible on subsequent opens. It should be hidden to avoid that users can override the filter

 

How can we avoid this behavior and ensure the initial query is always hidden?

 

Here's an (incomplete) code snippet that shows how we create a picker in plain Javascript:

 

... create app and create variable ResourcePicker

let picker = ResourcePicker.create(app, { resourceType: ResourcePicker.ResourceType.Collection, options: { initialQuery: '... query ...', selectMultiple: true, showHidden: false } });
picker.subscribe(ResourcePicker.Action.SELECT, function (selection) { ... }); picker.dispatch(ResourcePicker.Action.OPEN);

 

Bart Coppens | Limoni Apps | Building apps for Shopify since 2016
0 Likes
Shopify Staff
Shopify Staff
23 4 7

Hi Bart,

 

Thanks the thorough bug report! I’ve reproduced the bug and opened an issue. I’ll post updates here.

 

Iain

1 Like