Use router to set url instead of href
Directly using href bypasses the router-model which ends up completely
reloading the page. Using the model means viewStateChanged method is
called in GrChangeView.
Release-Notes: skip
Change-Id: I5d10ec93c45b892470c1993db844a852cd899966
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts
index 91b82dc..bd82262 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts
@@ -1279,8 +1279,13 @@
<a
class="changeNumber"
aria-label=${`Change ${this.change?._number}`}
- href=${ifDefined(this.computeChangeUrl(true))}
- @click=${(e: MouseEvent) => e.stopPropagation()}
+ @click=${(e: MouseEvent) => {
+ const url = this.computeChangeUrl(true);
+ if (url) {
+ this.getNavigation().setUrl(url);
+ }
+ e.stopPropagation();
+ }}
>${this.change?._number}</a
>
</gr-button>