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");
        title : "File Must Be PDF",
        message:'The file you tried to upload does not have a pdf extension', 
        key: 'info_alt',
        type: 'error',
        mode: 'dismissible'

1 Answer 1


The problem came from the "dismissible" mode. Once I changed it to "pester" the problem went away

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .