Last active
February 3, 2020 22:39
-
-
Save ZhenDeng/29388c0684208ac635675bcbc6813a06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML: | |
<input type="submit" class="btn btn-login register-submit" (click)="keyboardFocus(focusChange)" value="Stay on the page" #focusChange> | |
Component: | |
@ViewChild('focusChange') elChange: ElementRef; | |
setTimeout(() => { | |
this.elChange.nativeElement.focus(); | |
}, 100 | |
keyboardFocus(event): void { | |
event.style.outline = "2px solid blue"; | |
} | |
// used for angular material layout | |
keyboardMatTableFocus(event): void { | |
event.srcElement.style.outline = "2px solid blue"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment