Skip to content

Commit

Permalink
Allow dependent fields to work with multiple dependencies
Browse files Browse the repository at this point in the history
Previously we were clobbering any query params that had been set by a
previous update to dependent fields. This PR makes it so that we retain
any query params that were already set and we just update the one that
has changed.
  • Loading branch information
jagthedrummer committed Aug 20, 2024
1 parent bfc079c commit ecac208
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class extends Controller {
}

constructNewUrlUpdatingField(fieldName, fieldValue) {
const url = new URL(window.location.href)
const url = new URL(this.element.src || window.location.href)
url.searchParams.set(fieldName, fieldValue)

return url.href
Expand Down

0 comments on commit ecac208

Please sign in to comment.