Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label got an empty value ... error in app.py #5

Open
alicecommits opened this issue Jun 28, 2023 · 0 comments
Open

label got an empty value ... error in app.py #5

alicecommits opened this issue Jun 28, 2023 · 0 comments

Comments

@alicecommits
Copy link

Hi,
As I wrote in this streamlit blog thread, I've encountered the following error when running streamlit run app.py:
``label got an empty value. This is discouraged for accessibility reasons and may y be disallowed in the future by raising an exception. Please provide a non-empty label and hide it withab label_visibility if needed

I tried to troubleshoot any widget causing the issue as mentioned in the article. The only modification that seemed to work for me to get rid of the error was to set label=" ".

Original code in app.py:

    uploaded_file = st.file_uploader(
        "",
        key="1",
        help="To activate 'wide mode', go to the hamburger menu > Settings > turn on 'wide mode'",
    )

It seems like the absence of label in the double quote generates the error.

For now my attempts at working around the issue are:

Option A - but I can't seem to see any influence triggered by the label_visibility = 'collapsed' property :

    uploaded_file = st.file_uploader(
        label=" ",
        label_visibility='collapsed',
        key="1",
        help="To activate 'wide mode', go to the hamburger menu > Settings > turn on 'wide mode'",    
    )

Note: "hidden" works as well instead of "collapsed" but seems to introduce extra space for me between the title of the app and the drag/drop widget...

Option B: a whitespace as the label value, no label_visibility property...:

    uploaded_file = st.file_uploader(
        label=" ",
        key="1",
        help="To activate 'wide mode', go to the hamburger menu > Settings > turn on 'wide mode'",
    )

Either way, do you happen to have encountered that issue? If yes, what is the cleaner solution for it?
Thanks in advance,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant