Skip to content

Commit

Permalink
fix: scroll to the top of the report when iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Aug 23, 2023
1 parent f944bb9 commit df43293
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server/report/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ class App extends LitElement {
}
_handleNextClick() {
this._updateSearchParams(this._next);
this._scrollToTop();
}
_handleOverlayChange(e) {
this._overlay = e.target.checked;
}
_handlePrevClick() {
this._updateSearchParams(this._prev);
this._scrollToTop();
}
_renderError(message, source) {
return html`<div class="padding"><p>${message}: <b>${source}</b>.</p></div>`;
Expand Down Expand Up @@ -325,7 +327,7 @@ class App extends LitElement {
if (tabs.length < 2) return nothing;
return renderTabButtons('browser results', tabs, index => {
this._selectedBrowserIndex = index;
this.shadowRoot.querySelector('.tab-panels').scrollTo(0, 0);
this._scrollToTop();
this.requestUpdate();
});
}
Expand Down Expand Up @@ -410,6 +412,9 @@ class App extends LitElement {
`;

}
_scrollToTop() {
this.shadowRoot.querySelector('.tab-panels').scrollTo(0, 0);
}
_updateFiles() {

const files = [];
Expand Down

0 comments on commit df43293

Please sign in to comment.