Skip to content

Wrong filter state on backward navigation #340

@jcruzv-prog

Description

@jcruzv-prog

When using the browser's back navigation, the filter state becomes desynchronized from the URL parameters. The UI shows outdated filter values while the URL contains the correct ones.

Steps to Reproduce

  1. Apply filters using the filter component (e.g., set city to "New York")
  2. Use browser's back button
  3. Observe that filter UI doesn't match URL parameters

Expected Behavior

Filter state should always be synchronized with URL search parameters, including during browser navigation.

Root Cause

The component uses React state for filters that doesn't get updated when URL changes via browser navigation. The useState(initialFilters) only uses the initial value on first render.

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