Skip to content

New string query items not added to the path with $router.push #2907

@quentinw92

Description

@quentinw92

Screenshot 2019-08-24 at 13 27 41

Version

3.0.6

Reproduction link

The console log attached makes the error immediately obvious. The 3rd array item should be in the url, but is missing.

https://jsfiddle.net/chrisvfritz/50wL7mdz/

Steps to reproduce

  1. Create an array of bedroom_count values that can be any or all of the following values [1,2,3,4]
  2. Use $router.push to send through an array of bedroom_count options. e.g. [1,2]
  3. Now use $router.push to send through a new array of bedroom_count options e.g [1,2,3]
  4. The router will abort without updating the url with the new string queries

What is expected?

String queries variables should match the array items selected

The first push should update the URL to:
?bedroom_counts=1&bedroom_counts=2

The second push should update the URL to:
?bedroom_counts=1&bedroom_counts=2&bedroom_counts=3

What is actually happening?

$router.push aborts without adding new values to the URL.

The second push remains the same
?bedroom_counts=1&bedroom_counts=2

However there is now a new value in the array of bedroom_counts in $route.query has been updated.

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