web/flow: grab focus to uid input field (#13177) Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens L. <jens@goauthentik.io>
This commit is contained in:
committed by
GitHub
parent
07eb5fe533
commit
39aafbb34a
@ -193,6 +193,9 @@ export class InputPassword extends AKElement {
|
|||||||
* the `autofocus` attribute isn't enough, due to timing within shadow doms and such.
|
* the `autofocus` attribute isn't enough, due to timing within shadow doms and such.
|
||||||
*/
|
*/
|
||||||
observeInputFocus(): void {
|
observeInputFocus(): void {
|
||||||
|
if (!this.grabFocus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.inputFocusIntervalID = setInterval(() => {
|
this.inputFocusIntervalID = setInterval(() => {
|
||||||
const input = this.inputRef.value;
|
const input = this.inputRef.value;
|
||||||
|
|
||||||
@ -219,7 +222,9 @@ export class InputPassword extends AKElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
clearInterval(this.inputFocusIntervalID);
|
if (this.inputFocusIntervalID) {
|
||||||
|
clearInterval(this.inputFocusIntervalID);
|
||||||
|
}
|
||||||
|
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user