Skip to content

Commit

Permalink
fix(modal): use keydown for key listener
Browse files Browse the repository at this point in the history
  • Loading branch information
dtsanevmw committed Nov 26, 2024
1 parent bed30e6 commit ad6889a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/angular/src/modal/modal-stack.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ModalStackService {
}

if (isPlatformBrowser(this.platformId)) {
document.body.addEventListener('keyup', this.keyUpEventListener);
document.body.addEventListener('keydown', this.keyUpEventListener);
}
}

Expand All @@ -40,7 +40,7 @@ export class ModalStackService {
}

if (this.modalStack.length === 0 && isPlatformBrowser(this.platformId)) {
document.body.removeEventListener('keyup', this.keyUpEventListener);
document.body.removeEventListener('keydown', this.keyUpEventListener);
}
}

Expand Down
5 changes: 5 additions & 0 deletions projects/demo/src/app/wizard/wizard-basic.demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<clr-wizard-button [type]="'finish'">Finish</clr-wizard-button>

<clr-wizard-page>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<ng-template clrPageTitle>Title for page 1</ng-template>
<!-- mandatory -->
<ng-template clrPageNavTitle>Step 1</ng-template>
Expand Down

0 comments on commit ad6889a

Please sign in to comment.