From 5202de55247fa83e3dff5637a78e34df482481eb Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Mon, 6 Jul 2020 18:23:00 +0200 Subject: [PATCH] Fixed `swapSpec` when `view` --- src/htmx.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index 98116357..80b5a7b4 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -1338,7 +1338,7 @@ return (function () { swapSpec["scroll"] = modifier.substr(7); } if (modifier.indexOf("view:") === 0) { - swapSpec["view"] = modifier.substr(7); + swapSpec["view"] = modifier.substr(5); } } } @@ -1374,10 +1374,10 @@ return (function () { } } if (swapSpec.view) { - if (swapSpec.scroll === "top") { + if (swapSpec.view === "top") { target.scrollIntoView(true); } - if (swapSpec.scroll === "bottom") { + if (swapSpec.view === "bottom") { target.scrollIntoView(false); } }