From 4ae7090a5125d89bde7c95a420c80fe619b4e50d Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 25 Aug 2021 20:55:58 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B04062=20-=20Advanced=20search:=20Fix=20vi?= =?UTF-8?q?sual=20glitch=20when=20submitting=20the=20search=20while=20the?= =?UTF-8?q?=20results=20are=20sticking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/search/search_form_handler.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index 7324a02fc..460271caa 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -1091,6 +1091,8 @@ $(function() this.submit.xhr.abort(); } + // Remove sticky state as we want to return at the beginning of the results + this._exitStickyState(); // Show loader this._showLoader(); this._cleanMessageArea(); @@ -1374,6 +1376,16 @@ $(function() }); } }, + /** + * Exit the sticky state for the whole search, returning to the top of the results + * @return {void} + */ + _exitStickyState: function() + { + this._onFormStopsBeingSticky(); + this._onResultsStopsBeingSticky(); + this.element.scrollParent().scrollTop(); + }, /** * @param oElem {Object} jQuery object representing the element to test * @return {boolean} True if oElem is currently sticking