Skip to content

Commit ac36068

Browse files
FreakPirateShubham Sahu
andauthored
fix: smooth scroll to search input with dynamic banner offset (#1624)
* fix: smooth scroll to search input with dynamic banner offset * refactor: enhance scroll behavior to search input for smoother user experience --------- Co-authored-by: Shubham Sahu <[email protected]>
1 parent f0fb2fd commit ac36068

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

djangoproject/static/js/djangoproject.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ window.addEventListener('keydown', function (e) {
9797
const el = document.querySelector('#id_q');
9898

9999
el.select();
100-
el.focus({ preventScroll: true });
101-
el.scrollIntoView({ behavior: 'smooth' });
100+
el.focus();
101+
102+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
102103
});
103104

104105
// Add copy buttons to code snippets

0 commit comments

Comments
 (0)