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

Right-side label of st.slider and st.select_slider overflows when inside st.expander #6297

Closed
4 of 5 tasks
cmayoracurzio opened this issue Mar 11, 2023 · 1 comment · Fixed by #6828
Closed
4 of 5 tasks

Comments

@cmayoracurzio
Copy link

cmayoracurzio commented Mar 11, 2023

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

Right-side label of st.slider and st.select_slider overflows when inside st.expander.

In the past I submitted a similar issue for the left-side label (see #5898); now it is the right-side label that is misbehaving.

Reproducible Code Example

Open in Streamlit Cloud

import streamlit as st

st.title("Right-side label of slider and select_slider overflows when inside expander")

with st.expander('Example st.expander'):

    single_value = st.slider(
        label='Example st.slider',
        min_value=9_500_000,
        max_value=10_000_000,
        value=10_000_000
    )

    first_value,last_value = st.slider(
        label='Example st.slider (range mode)',
        min_value=9_500_000,
        max_value=10_000_000,
        value=(9_500_000,10_000_000)
    )

    single_value = st.select_slider(
        label='Example st.select_slider',
        options=['Maradona','Ronaldo','Pele','This is a very, very long label'],
        value='This is a very, very long label'
        )

    first_value,last_value = st.select_slider(
        label='Example st.select_slider (range mode)',
        options=['Maradona','Ronaldo','Pele','This is a very, very long label'],
        value=['Maradona','This is a very, very long label']
        )

Steps To Reproduce

  1. Run the reproducible code example
  2. Open the expander and see that all the right side labels are overflowing

Expected Behavior

Labels should not overflow beyond the widgets width.

Current Behavior

No response

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.20.0
  • Python version: 3.11
  • Operating System: macOS
  • Browser: Brave
  • Virtual environment: conda

Additional Information

No response

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!
@LukasMasuch
Copy link
Collaborator

@marduk2 Thanks for reporting this issue. I was able to reproduce it here. It seems to happen after the second expansion:

image

@LukasMasuch LukasMasuch added priority:P3 status:confirmed Bug has been confirmed by the Streamlit team and removed status:needs-triage Has not been triaged by the Streamlit team labels Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants