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"):
st.success(name)
if __name__ == '__main__':
# run_streamlit()
minimum_example()
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.
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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.