I'm using the legacy version of Inertia "^0.11.1". I don't understand why my page is scrolling back to the top after submitting my forms.
Here is my code.
<script setup>
import {useForm} from "@inertiajs/inertia-vue3";
import InputError from "@/Components/InputError.vue";
let form = useForm({
email: null,
first_name: null,
last_name: null,
});
let submit = () => {
form.post('/subscribe', {
onSuccess: () => {
form.reset();
},
// onError: () => {
// alert('Something went wrong. Try again later.');
// },
}, {preserveScroll:true})
};
</script>
Shouldn't the preserveScroll:true statement prevent this? What am I missing? The '/subscribe' endpoint calls a 3rd party API but doesn't have an explicit redirect.