You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Filter slider keeps a stale pickupPoint facet when switching delivery methods #3605
Filter slider keeps a stale pickupPoint facet when switching delivery methods
Summary
In useDeliveryPromise.onDeliveryFacetChange, the branch that handles any
facet other than pickup-in-point computes a filtered facet list and then
calls facetsToToggle.concat(currentSelectedFacets) — concat returns a new
array, so the call is a no-op and the stale pickupPoint facet survives in the
filter drawer's selected state.
Steps to reproduce
On a PLP with Delivery Promise enabled and a postal code set, select
"pickup in point" so shipping=pickup-in-point + pickupPoint=<id> are
selected.
Open the mobile filter drawer (FilterSlider) and switch the delivery
method to "delivery".
Expected
selected becomes [{shipping: delivery}] — the pickup point facet is dropped,
matching what the desktop filter (FilterDesktop, same hook, non-dispatch path)
already does.
Actual
selected becomes [{shipping: delivery}, {pickupPoint: <id>}]. Because pickupInPointFacet.selected is true whenever any pickupPoint facet is
selected, the "pickup in point" radio still renders as selected next to
"delivery". Worse: toggling back to "pickup in point" then toggles the stale
facet OFF, so the shopper ends up with shipping=pickup-in-point and no pickupPoint — the chosen pickup point is silently lost from the URL/query.
The applyBtn handler in FilterSlider already strips pickupPoint manually,
which shows this removal was intended for both paths.
Activity