Skip to content

Commit b3a1efa

Browse files
committed
Add scroll to top on search input change
- Automatically scroll snippet list to top when search query changes - Improves UX by showing search results from the beginning - Users can immediately see the most relevant results
1 parent 19910b1 commit b3a1efa

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

public/js/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ document.addEventListener('DOMContentLoaded', () => {
208208
// Search functionality
209209
const clearSearchButton = document.getElementById('clear-search');
210210
searchInput.addEventListener('input', (e) => {
211+
// Scroll to top of snippet list when search changes
212+
snippetsContainer.scrollTop = 0;
213+
211214
const query = e.target.value;
212215
const activeSnippets = dbData.snippets.filter(s => !s.isDeleted);
213216

0 commit comments

Comments
 (0)