I have a normal toast event on a lightning component that is halfway down a page that consists of several lightning components. When the toast event fires, the toast appears and once it is closed the page will jump to the top of the page. Is there a way to stop this behavior. I have tried event.preventDefault()
which doesn't work and window.scrollTo()
which resets the page to where I need it but only after it jumps to the top of the page.
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
title : "File Must Be PDF",
message:'The file you tried to upload does not have a pdf extension',
duration:'1000',
key: 'info_alt',
type: 'error',
mode: 'dismissible'
});
toastEvent.fire();