-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelling file picker closes my stepper #3211
Comments
@Tharrington86 , |
@JeevaRP-SDE Cancelling the file picker closes the stepper and causes the entered data to be lost. Cancelling the file picker after selecting and then deleting does not cause the stepper to close for one iteration, then closes stepper. |
I confirmed that the file input is emitting a cancel event that is reaching my stepper component by adding an event listener to its constructor. Is there a way to make the stepper ignore that event? |
I was finally able to solve my problem by using HostListener to listen for the cancel event and stopping its propagation on my upload component. @HostListener('cancel', ['$event'])
onCancel(event: Event){
console.log('Cancel host listener.');
event.stopImmediatePropagation();
}; |
I am working on an Angular web app that collects data via a Nebular Stepper component. One of the steps allows users to attach images or documents using a file picker. Attaching an item works as expected but if you cancel the file picker, the underlying stepper dialog also closes and its data is lost. Am I correct to assume that this is being caused by the cancel event firing when closing the file picker? Is there a way to prevent that event from reaching the dialog?
stepper.component.ts
stepper.component.html
mat-file-upload.component.ts
The text was updated successfully, but these errors were encountered: