Add autocomplete attribute to credential fields

Prevent browsers from automatically autofilling the password entry box
for the Factorio credentials by setting the autocomplete property to
new-password on the password input.
This commit is contained in:
Hornwitser committed 2024-09-18 23:10:31 +02:00
1 parent 44e5847a1d
commit f873f4b369
3 files changed
+13 -3

No files matched your search

@@ -44,12 +44,12 @@ function renderInput(inputComponents: Record<string, InputComponent>, def: lib.F
}
if (def.type === "string") {
if (def.credential) {
return <Input.Password/>;
return <Input.Password autoComplete={def.autoComplete} />;
}
return <Input/>;
return <Input autoComplete={def.autoComplete} />;
}
if (def.type === "number") {
return <InputNumber/>;
return <InputNumber autoComplete={def.autoComplete} />;
}
return `Unknown type ${def.type}`;