Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

feat: scroll into view when filtering by channel

Christian Feiba121ea57002
diff --git a/client/components/channels-list.js b/client/components/channels-list.js
index 90b9185..5c65ae5 100644
--- a/client/components/channels-list.js
+++ b/client/components/channels-list.js
@@ -62,6 +62,7 @@ class ChannelsList extends HTMLElement {
event.target.classList.add('active')
}
this.$searchInput.dispatchEvent(new Event('keyup'))
+ setTimeout(() => document.body.scrollIntoView({ top: 0, behavior: 'smooth' }), 10)
}
}
customElements.define('channels-list', ChannelsList)