Skip to content

Commit

Permalink
revoke scroll fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadeperfect committed Nov 27, 2024
1 parent 91ceaa0 commit 740ed98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions fix_js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Detect OS and use appropriate sed command
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js
else
# Linux and others
sed -i 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js
fi
4 changes: 1 addition & 3 deletions out/bevy_vaporwave.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,7 @@ function __wbg_get_imports() {
return ret;
};
imports.wbg.__wbg_focus_06621101cc79f5d8 = function() { return handleError(function (arg0) {
const scrollPos = window.scrollY;
getObject(arg0).focus();
window.scrollTo(0, scrollPos);
arg0.focus();
}, arguments) };
imports.wbg.__wbg_fetch_0b9f0f8239b62e25 = function(arg0, arg1, arg2) {
const ret = arg0.fetch(getStringFromWasm0(arg1, arg2));
Expand Down

0 comments on commit 740ed98

Please sign in to comment.