0

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();
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.