Browse Source
Merge pull request #17920 from abpframework/issue-17919
Fix getModifierState error at CapsLockDirective
pull/17937/head
Masum ULU
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
4 additions and
4 deletions
-
npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts
-
npm/ng-packs/packages/core/src/lib/tests/capsLock.directive.spec.ts
-
npm/ng-packs/packages/core/src/lib/tests/show-password-directive.spec.ts
|
|
|
@ -21,7 +21,7 @@ export class TrackCapsLockDirective { |
|
|
|
if ( |
|
|
|
(s.toUpperCase() === s && s.toLowerCase() !== s && e.shiftKey) || |
|
|
|
(s.toUpperCase() !== s && s.toLowerCase() === s && e.shiftKey) || |
|
|
|
e.getModifierState('CapsLock') |
|
|
|
(e.getModifierState && e.getModifierState('CapsLock')) |
|
|
|
) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ import { By } from '@angular/platform-browser'; |
|
|
|
imports:[TrackCapsLockDirective] |
|
|
|
}) |
|
|
|
class TestComponent { |
|
|
|
capsLock:boolean = false |
|
|
|
capsLock = false |
|
|
|
} |
|
|
|
|
|
|
|
describe('TrackCapsLockDirective',()=>{ |
|
|
|
|
|
|
|
@ -13,7 +13,7 @@ import { By } from '@angular/platform-browser'; |
|
|
|
imports:[ShowPasswordDirective] |
|
|
|
}) |
|
|
|
class TestComponent { |
|
|
|
showPassword:boolean = false |
|
|
|
showPassword = false |
|
|
|
} |
|
|
|
|
|
|
|
describe('ShowPasswordDirective',()=>{ |
|
|
|
@ -46,7 +46,7 @@ describe('ShowPasswordDirective',()=>{ |
|
|
|
}); |
|
|
|
|
|
|
|
it('should have three input has ShowPasswordDirective elements', () => { |
|
|
|
let input = des[2].nativeElement |
|
|
|
const input = des[2].nativeElement |
|
|
|
expect(input.type).toBe('password') |
|
|
|
fixture.componentInstance.showPassword = true |
|
|
|
fixture.detectChanges() |
|
|
|
|