Skip to content

Commit 033eb82

Browse files
committed
reinitialize search_params too when href set
1 parent 2d14452 commit 033eb82

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/browser/url/url.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,11 @@ pub const URL = struct {
281281
/// `Internal` error for failing cases.
282282
const SetterError = error{Internal};
283283

284-
// FIXME: reinit search_params?
285-
pub fn set_href(self: *const URL, input: []const u8) SetterError!void {
284+
pub fn set_href(self: *URL, input: []const u8, page: *Page) !void {
286285
_ = ada.setHref(self.internal, input);
287286
if (!ada.isValid(self.internal)) return error.Internal;
287+
// Can't call `get_search` here since it uses `search_params`.
288+
self.search_params = try prepareSearchParams(page.arena, self.internal);
288289
}
289290

290291
pub fn set_host(self: *const URL, input: []const u8) SetterError!void {

0 commit comments

Comments
 (0)