web/flows: only add helper username input if using native shadow dom to prevent browser confusion
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
9b7f57cc75
commit
28e675596b
|
@ -76,6 +76,9 @@ export class IdentificationStage extends BaseStage<
|
|||
firstUpdated(): void {
|
||||
this.form = document.createElement("form");
|
||||
document.documentElement.appendChild(this.form);
|
||||
// Only add the additional username input if we're in a shadow dom
|
||||
// otherwise it just confuses browsers
|
||||
if (!("ShadyDOM" in window)) {
|
||||
// This is a workaround for the fact that we're in a shadow dom
|
||||
// adapted from https://github.com/home-assistant/frontend/issues/3133
|
||||
const username = document.createElement("input");
|
||||
|
@ -94,6 +97,7 @@ export class IdentificationStage extends BaseStage<
|
|||
});
|
||||
};
|
||||
this.form.appendChild(username);
|
||||
}
|
||||
const password = document.createElement("input");
|
||||
password.setAttribute("type", "password");
|
||||
password.setAttribute("name", "password");
|
||||
|
|
Reference in New Issue