mardi 5 avril 2016

Ember.js query params not respecting replace: true and using replaceState

I'm having a problem where my query params are all set to use replace: true, but when I change the properties, the query params are being updated using pushState instead of replaceState.

You can see this behaviour at: http://ift.tt/1S7obUK

So as the filters are changed, the query params update, but it happens using pushState, so after you've changed the filter a few times. If you then click back you start moving through the history of previous filtering combinations

Any help much appreciated!!

My query params definition looks like:

queryParams: {
  selectedCountryNames: {
    replace: true,
    as: 'countries'
  },
  selectedExperienceNames: {
    replace: true,
    as: 'experiences'
  },
  selectedActivityNames: {
    replace: true,
    as: 'activities'
  },
  selectedWildlifeNames: {
    replace: true,
    as: 'wildlife'
  },
  selectedMonthNames: {
    replace: true,
    as: 'month'
  },
  selectedTripLengths: {
    replace: true,
    as: 'length'
  },
  selectedBudgets : {
    replace: true,
    as: 'budget'
  }
},




Aucun commentaire:

Enregistrer un commentaire