Skip to content

Passing an undefined query param can prevent the url from updating #2641

Closed
@cvn

Description

@cvn

Version

3.0.2

Reproduction link

https://plnkr.co/edit/yJJpcKuhYQwdOk3nZcZs?p=preview

Steps to reproduce

  1. Start with the url /?q=foo&color=bar.
  2. this.$router.push({query: {q: 'foo', offset: undefined}})

What is expected?

I expect the url to change to /?q=foo

What is actually happening?

The url does not change


I'm doing search filtering using query params. Every time I change a filter, I
add/remove/modify the appropriate param, and reset my pagination by setting
an offset param to undefined. In my app, the combination of removing a param
and offset not being set to begin with, causes the route not to update.

This issue is easy enough to work around, but it took me a while to figure out
what was going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed on 4.xThis issue has been already fixed on the v4 but exists in v3improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions