emberjs / emberjs/ember.js

Array query params do not track mutation

Open
#14,865 3 comments 0 reactions 0 assignees View on GitHub
bug Has Reproduction Needs Submitter Response Query Params Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

If you have a link like this one: `{{#link-to 'foo' (query-params numbers=numbers)}}` the URL of the link does not get updated if `numbers` is mutated with `pushObject/removeObject`, you have to replace the array by a different array.

It's not too bad as a bug because clicking the link still works as expected when clicked, it's just the href of the link the one that doesn't update. Perhaps something to take into account in the new `url-for` helpers that is part of the new route service.

Reproduction in a twiddle: https://ember-twiddle.com/ac26716b462cf3e53398b42a390a29e3?openFiles=controllers.application.js%2C&route=%2Ffoo%3Fnames%3D%255B%2522Mary%2522%255D

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.