Skip to content

Filter slider keeps a stale pickupPoint facet when switching delivery methods #3605

Backlog

Description

@caiotheodoro

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

  1. 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.
  2. 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.

Environment

@faststore/core on dev (4.12.0-dev.1).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions