1

Recently a new bug came up which disabled the output window of the file select dialog.

<!-- shown in Maximilian Schwarzmuller Angular & NodeJS - The MEAN Stack Guide -->
<form [formGroup]="form" style="width: 100%">

   <div class="row" [ngStyle]="{'height': editing[0] ? 'fit-content' : '200%'}">
      <div class="col-12 d-flex justify-content-center" *ngIf="editing[0]">
         <button mat-button [color]="'edit-color'" type="button" (click)="image.click()">Add Image</button>
      </div>
      <input type="file" (change)="onImagePicked($event)" (click)="clicked()" #image>
   </div>

   ...form of image display...

</form>

whenever i call a click event in the mat-button it always gets called, same as in type="file", but the dialog in which i should select a file is never opened.

I assume the problem stems from this page being inside a mat-dialog, which is probably somehow conflicting with the browsers internal dialogs.

for now error has been seen in chrome and safari in development and production.

I am searching for a way to open a file dialog(browser) in my current page architecture.

1 Answer 1

1

Strange enough the issue wasn't the dialog. It was a click event called in html a bit higher up.

<h2 matRipple (click)="hamburgerClicked = !hamburgerClicked">
   <i class="fas fa-bars" mat-icon-button aria-label="Close dialog"></i>
</h2>

i just changed it to a function

<h2 matRipple (click)="clicked()">
   <i class="fas fa-bars" mat-icon-button aria-label="Close dialog"></i>
</h2>

and it works like a charm.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.