From: Jacob Casper Date: Thu, 10 Feb 2022 20:16:03 +0000 (-0600) Subject: Leave click scrolling up to the browser X-Git-Tag: v0.7.1~1 X-Git-Url: https://git.jacobcasper.com/?p=hnim.git;a=commitdiff_plain;h=c5cca1fac332a02b759b915f0bfc081504fc36e2 Leave click scrolling up to the browser We have the comment element, so let the browser do the work of fixing our infinite loops. --- diff --git a/hnim.js b/hnim.js index 7ac3f5d..1e804b3 100644 --- a/hnim.js +++ b/hnim.js @@ -32,7 +32,7 @@ const change = (comment) => { elementsIndex = elements.indexOf(comment); - changeWithVisibleCallback(comment, () => {}); + changeWithVisibleCallback(comment, () => {comment.scrollIntoView()}); } // Curry callback for moving downpage