How to enable email autocomplete for the passwordl...
# support-questions-legacy
t
How to enable email autocomplete for the passwordless login field?
r
Hi. What do you mean by email auto complete?
t
mobile browsers don't suggest to save the email --> users have to retype their emails on next login
Solution according to AI: "The autocomplete attribute is used to specify whether a form or input field should have autocomplete enabled or disabled. By setting the autocomplete attribute to "email", you are telling the browser to remember and autofill the email address entered by the user."
but how I do that with supertokens?
Any hack or anything would be helpful
r
@porcellus can help here.
p
hi
This is something we'd have to patch, it looks like something we missed. As a quick/hacky solution, you could try and find the input element (the on you have highlighted) and update the prop during pageload.
that'd look something like this:
Copy code
document.querySelector("#supertokens-root").shadowRoot.querySelector("input[name=email]").autocomplete = "email"
if you have not disabled the shadowDom
t
Thanks, I'll try this. Have to figure out a good place for the code
p
you can put it in a
useLayoutEffect
I think the best place to put it would be a
useLayoutEffect
in a component overriding
PasswordlessEmailForm
. See this for more info: https://supertokens.com/docs/passwordless/advanced-customizations/react-component-override/usage If you need further help I can come up with a snippet a bit later.
as an alternative, you could override the entire
PasswordlessEmailForm
component with your own solution, but that is a bit more involved.
t
The components don’t yet exist in useLayoutEffect so I can’t modify the element
r
You need to override our component and add the useLayoutEffect in that
2 Views