From 32fc2ebb31bbc09238ebd711e005aeae2e435e59 Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Wed, 23 Aug 2023 15:31:09 -0400 Subject: [PATCH] fix: scroll to the top of the report when iterating (#143) --- src/server/report/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/report/app.js b/src/server/report/app.js index 1c5dc4b9..64513367 100644 --- a/src/server/report/app.js +++ b/src/server/report/app.js @@ -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`

${message}: ${source}.

`; @@ -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(); }); } @@ -410,6 +412,9 @@ class App extends LitElement { `; } + _scrollToTop() { + this.shadowRoot.querySelector('.tab-panels').scrollTo(0, 0); + } _updateFiles() { const files = [];