Text inputs with autofill tool (password manager)


Hello, I struggle with filling text inputs with my password manager (Dashlane, but I don’t think it matters)
When the fields are filled this way and I get what’s inside the text input I get an empty string. My guess is that usually typing something in a field triggers a callback and using an autofill tool does not trigger it.

Steps to reproduce

Code snippet:

def minimum_example():
    name = st.text_input("First Name")
    if st.button("Submit"):

if __name__ == '__main__':
    # run_streamlit()

Obviously to reproduce the example you need a password manager. I use Dashlane which is free and automatically recognize this field as asking for my first name.

Expected behavior:

We would expect for the app to get what’s intisde those fields. Although I understand we may not be able to constantly check what’s inside all the fields all the time, I would need a way to trigger a check when pressing the submit button.
I did not find anyone talking about this issue or any solution.

Actual behavior:

Debug info

  • Streamlit version: 1.26.0
  • Python version: 3.10.12
  • OS version: Linux

Actually the code can run as is and I don’t understand how it is related to a password manager.

When you type in a textbox, the new value isn’t available to the application until the you press Enter or change the focus to another widget. It doesn’t matter if you type with your fingers or you paste from the clipboard or you use some magic to fill the widget.

Yes, if you run the code as is you can type somthing in the input field, press the submit button and it will show your name.
But if instead of putting it by hand a password manager puts it in for you it doesnt’t work anymore (which defeat the purpose of the autofill), see 2nd screenshot, the success output is empty even though the field is not. (I pressed the submit button after my password manager put my name in the field)

I think I understand now. So it doesn’t really work the same as typing or pasting from the clipboard. I guess Dashlane is using javascript to fill the textbox and it doesn’t go well along with the javascript from streamlit.

There is a thread by a user trying to programmatiically update text in chat_input that might be showing a similar issue. Unfortunately no solution is provided other than not using javascript.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.