diff --git a/npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts b/npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts index 7da2eb32cf..0194bb9d3e 100644 --- a/npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts +++ b/npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts @@ -9,14 +9,14 @@ export class TrackCapsLockDirective { @HostListener('window:keydown', ['$event']) onKeyDown(event: KeyboardEvent): void { - this.capsLock.emit(this.capS(event)); + this.capsLock.emit(this.isCapsLockOpen(event)); } @HostListener('window:keyup', ['$event']) onKeyUp(event: KeyboardEvent): void { - this.capsLock.emit(this.capS(event)); + this.capsLock.emit(this.isCapsLockOpen(event)); } - capS(e) { + isCapsLockOpen(e): boolean { var s = String.fromCharCode(e.which); if ( (s.toUpperCase() === s && s.toLowerCase() !== s && e.shiftKey) ||