From b92395d4854ce71f96c90d42924a234b9b9a32e2 Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Tue, 13 Dec 2022 12:50:12 +0000 Subject: [PATCH] Make notices speak when shown --- assets/js/data/cart/notify-quantity-changes.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/data/cart/notify-quantity-changes.ts b/assets/js/data/cart/notify-quantity-changes.ts index 7c8790183f0..a82db752ca0 100644 --- a/assets/js/data/cart/notify-quantity-changes.ts +++ b/assets/js/data/cart/notify-quantity-changes.ts @@ -44,12 +44,15 @@ const notifyIfQuantityLimitsChanged = ( oldCart: Cart, newCart: Cart ) => { ), { context: 'wc/cart', + speak: true, type: 'snackbar', id: `${ cartItem.key }-quantity-update`, } ); return; } + + // Quantity is above max, so has been reduced. dispatch( 'core/notices' ).createInfoNotice( sprintf( /* translators: %1$s is the name of the item, %2$d is the quantity of the item. */ @@ -62,6 +65,7 @@ const notifyIfQuantityLimitsChanged = ( oldCart: Cart, newCart: Cart ) => { ), { context: 'wc/cart', + speak: true, type: 'snackbar', id: `${ cartItem.key }-quantity-update`, } @@ -98,6 +102,7 @@ const notifyIfQuantityChanged = ( ), { context: 'wc/cart', + speak: true, type: 'snackbar', id: `${ cartItem.key }-quantity-update`, }