Hi,
I’m experiencing an issue with my Admin UI Extension for product configuration. When navigating between different product pages in the Shopify admin interface, the extension does not update to reflect the newly selected product. Instead, it continues to display data from the initial product loaded.
Expected Behavior:
When a user navigates to a different product in the Shopify admin, the extension should update to display information relevant to the new product.
Please see screenshot attached. First product visited is on the left and the second product visited is on the right.
Observed Behavior:
The extension remains static, displaying the original product’s information, and does not react to navigation changes.
Please see screenshot attached. First product visited is on the left and the second product visited is on the right.
Steps to Reproduce:
- Install and enable the Admin UI Extension on a development store.
- Navigate to the Shopify admin and open a product page where the extension is displayed.
- Observe that the extension displays the correct information for the initial product.
- Use the Shopify admin interface to navigate to a different product (e.g., using the product list).
- Observe that the extension does not update and continues to display information from the initial product.
Actions I’ve tested:
- The
data
object fromuseApi(TARGET)
does not update upon navigation to a new product. - Neither
data.product.id
norextension.resource.id
change when selecting a different product. - The extension does not re-render or remount when navigating between products.
- There is no apparent method or API available within the Admin UI Extension environment to detect navigation events or context changes.
This is with:
api_version = "2024-07"
target = "admin.product-details.configuration.render"
I’ve triple checked the targets match in both files.
Based on my observations, it seems that data updating on navigation should be expected behavior since other admin extensions like the draft orders edit do not exhibit this issue. Can anyone confirm if this is the expected behavior for Admin UI Extensions when navigating between products? If so, could you provide guidance on how to ensure that the data
object updates correctly upon navigation, or how to detect navigation events or context changes within the Admin UI Extension environment?
Any assistance or insights would be greatly appreciated.