diff --git a/build_wasm.sh b/build_wasm.sh index 9b358cb..ab8caf7 100755 --- a/build_wasm.sh +++ b/build_wasm.sh @@ -2,3 +2,6 @@ set -e cargo build --release --target wasm32-unknown-unknown wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_vaporwave.wasm + +sed -i 's/getObject(arg0).focus();/const scrollPos = window.scrollY; getObject(arg0).focus(); window.scrollTo(0, scrollPos);/' ./out/bevy_vaporwave.js +