prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Right-side label of `st.slider` and `st.select_slider` overflows when inside `st.expander`
  ### Checklist
  
  - [x] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
  - [X] I added a very descriptive title to this issue.
  - [X] 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 https://github.com/streamlit/streamlit/issues/5898); now it is the right-side label that is misbehaving.
  
  ### Reproducible Code Example
  
  [![Open in Streamlit Cloud](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://issues.streamlitapp.com/?issue=gh-6297)
  
  ```Python
  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?
  
  - [X] 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!
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `e2e/scripts/st_select_slider.py`
  Content:
  ```
  1 # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 import numpy as np
  16 import pandas as pd
  17 
  18 import streamlit as st
  19 from streamlit import runtime
  20 
  21 w1 = st.select_slider(
  22     "Label 1",
  23     value=("orange", "blue"),
  24     options=["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
  25 )
  26 st.write("Value 1:", w1)
  27 
  28 w2 = st.select_slider(
  29     "Label 2",
  30     options=np.array([1, 2, 3, 4, 5]),
  31 )
  32 st.write("Value 2:", w2)
  33 
  34 w3 = st.select_slider(
  35     "Label 3",
  36     value=[2, 5],
  37     options=pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9]),
  38 )
  39 st.write("Value 3:", w3)
  40 
  41 w4 = st.select_slider(
  42     "Label 4",
  43     value=5,
  44     options=pd.DataFrame(
  45         {
  46             "first column": [1, 2, 3, 4, 5],
  47             "second column": [10, 20, 30, 40, 50],
  48         }
  49     ),
  50 )
  51 st.write("Value 4:", w4)
  52 
  53 w5 = st.select_slider(
  54     "Label 5",
  55     value=("orange", "blue"),
  56     options=["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
  57     disabled=True,
  58 )
  59 st.write("Value 5:", w5)
  60 
  61 w6 = st.select_slider(
  62     "Label 6",
  63     options=["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
  64     label_visibility="hidden",
  65 )
  66 
  67 st.write("Value 6:", w6)
  68 
  69 
  70 w7 = st.select_slider(
  71     "Label 7",
  72     options=["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
  73     label_visibility="collapsed",
  74 )
  75 
  76 st.write("Value 7:", w7)
  77 
  78 if runtime.exists():
  79 
  80     def on_change():
  81         st.session_state.select_slider_changed = True
  82 
  83     st.select_slider(
  84         "Label 8",
  85         options=np.array([1, 2, 3, 4, 5]),
  86         key="select_slider8",
  87         on_change=on_change,
  88     )
  89     st.write("Value 8:", st.session_state.select_slider8)
  90     st.write("Select slider changed:", "select_slider_changed" in st.session_state)
  91
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/e2e/scripts/st_select_slider.py b/e2e/scripts/st_select_slider.py
  --- a/e2e/scripts/st_select_slider.py
  +++ b/e2e/scripts/st_select_slider.py
  @@ -88,3 +88,12 @@
       )
       st.write("Value 8:", st.session_state.select_slider8)
       st.write("Select slider changed:", "select_slider_changed" in st.session_state)
  +
  +with st.expander("Expander", expanded=True):
  +    w9 = st.select_slider(
  +        label="Label 9",
  +        options=["foo", "bar", "baz", "This is a very, very long option"],
  +        value="This is a very, very long option",
  +    )
  +
  +    st.write("Value 9:", w9)
  
verification_info: {"golden_diff": "diff --git a/e2e/scripts/st_select_slider.py b/e2e/scripts/st_select_slider.py\n--- a/e2e/scripts/st_select_slider.py\n+++ b/e2e/scripts/st_select_slider.py\n@@ -88,3 +88,12 @@\n     )\n     st.write(\"Value 8:\", st.session_state.select_slider8)\n     st.write(\"Select slider changed:\", \"select_slider_changed\" in st.session_state)\n+\n+with st.expander(\"Expander\", expanded=True):\n+    w9 = st.select_slider(\n+        label=\"Label 9\",\n+        options=[\"foo\", \"bar\", \"baz\", \"This is a very, very long option\"],\n+        value=\"This is a very, very long option\",\n+    )\n+\n+    st.write(\"Value 9:\", w9)\n", "issue": "Right-side label of `st.slider` and `st.select_slider` overflows when inside `st.expander`\n### Checklist\r\n\r\n- [x] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.\r\n- [X] I added a very descriptive title to this issue.\r\n- [X] I have provided sufficient information below to help reproduce this issue.\r\n\r\n### Summary\r\n\r\nRight-side label of `st.slider` and `st.select_slider` overflows when inside `st.expander`.\r\n\r\nIn the past I submitted a similar issue for the left-side label (see https://github.com/streamlit/streamlit/issues/5898); now it is the right-side label that is misbehaving.\r\n\r\n### Reproducible Code Example\r\n\r\n[![Open in Streamlit Cloud](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://issues.streamlitapp.com/?issue=gh-6297)\r\n\r\n```Python\r\nimport streamlit as st\r\n\r\nst.title(\"Right-side label of slider and select_slider overflows when inside expander\")\r\n\r\nwith st.expander('Example st.expander'):\r\n\r\n    single_value = st.slider(\r\n        label='Example st.slider',\r\n        min_value=9_500_000,\r\n        max_value=10_000_000,\r\n        value=10_000_000\r\n    )\r\n\r\n    first_value,last_value = st.slider(\r\n        label='Example st.slider (range mode)',\r\n        min_value=9_500_000,\r\n        max_value=10_000_000,\r\n        value=(9_500_000,10_000_000)\r\n    )\r\n\r\n    single_value = st.select_slider(\r\n        label='Example st.select_slider',\r\n        options=['Maradona','Ronaldo','Pele','This is a very, very long label'],\r\n        value='This is a very, very long label'\r\n        )\r\n\r\n    first_value,last_value = st.select_slider(\r\n        label='Example st.select_slider (range mode)',\r\n        options=['Maradona','Ronaldo','Pele','This is a very, very long label'],\r\n        value=['Maradona','This is a very, very long label']\r\n        )\r\n```\r\n\r\n\r\n### Steps To Reproduce\r\n\r\n1. Run the reproducible code example\r\n2. Open the expander and see that all the right side labels are overflowing\r\n\r\n### Expected Behavior\r\n\r\nLabels should not overflow beyond the widgets width.\r\n\r\n### Current Behavior\r\n\r\n_No response_\r\n\r\n### Is this a regression?\r\n\r\n- [X] Yes, this used to work in a previous version.\r\n\r\n### Debug info\r\n\r\n- Streamlit version: 1.20.0\r\n- Python version: 3.11\r\n- Operating System: macOS\r\n- Browser: Brave\r\n- Virtual environment: conda\r\n\r\n### Additional Information\r\n\r\n_No response_\r\n\r\n### Are you willing to submit a PR?\r\n\r\n- [ ] Yes, I am willing to submit a PR!\n", "before_files": [{"content": "# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport numpy as np\nimport pandas as pd\n\nimport streamlit as st\nfrom streamlit import runtime\n\nw1 = st.select_slider(\n    \"Label 1\",\n    value=(\"orange\", \"blue\"),\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n)\nst.write(\"Value 1:\", w1)\n\nw2 = st.select_slider(\n    \"Label 2\",\n    options=np.array([1, 2, 3, 4, 5]),\n)\nst.write(\"Value 2:\", w2)\n\nw3 = st.select_slider(\n    \"Label 3\",\n    value=[2, 5],\n    options=pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9]),\n)\nst.write(\"Value 3:\", w3)\n\nw4 = st.select_slider(\n    \"Label 4\",\n    value=5,\n    options=pd.DataFrame(\n        {\n            \"first column\": [1, 2, 3, 4, 5],\n            \"second column\": [10, 20, 30, 40, 50],\n        }\n    ),\n)\nst.write(\"Value 4:\", w4)\n\nw5 = st.select_slider(\n    \"Label 5\",\n    value=(\"orange\", \"blue\"),\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    disabled=True,\n)\nst.write(\"Value 5:\", w5)\n\nw6 = st.select_slider(\n    \"Label 6\",\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    label_visibility=\"hidden\",\n)\n\nst.write(\"Value 6:\", w6)\n\n\nw7 = st.select_slider(\n    \"Label 7\",\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    label_visibility=\"collapsed\",\n)\n\nst.write(\"Value 7:\", w7)\n\nif runtime.exists():\n\n    def on_change():\n        st.session_state.select_slider_changed = True\n\n    st.select_slider(\n        \"Label 8\",\n        options=np.array([1, 2, 3, 4, 5]),\n        key=\"select_slider8\",\n        on_change=on_change,\n    )\n    st.write(\"Value 8:\", st.session_state.select_slider8)\n    st.write(\"Select slider changed:\", \"select_slider_changed\" in st.session_state)\n", "path": "e2e/scripts/st_select_slider.py"}], "after_files": [{"content": "# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport numpy as np\nimport pandas as pd\n\nimport streamlit as st\nfrom streamlit import runtime\n\nw1 = st.select_slider(\n    \"Label 1\",\n    value=(\"orange\", \"blue\"),\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n)\nst.write(\"Value 1:\", w1)\n\nw2 = st.select_slider(\n    \"Label 2\",\n    options=np.array([1, 2, 3, 4, 5]),\n)\nst.write(\"Value 2:\", w2)\n\nw3 = st.select_slider(\n    \"Label 3\",\n    value=[2, 5],\n    options=pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9]),\n)\nst.write(\"Value 3:\", w3)\n\nw4 = st.select_slider(\n    \"Label 4\",\n    value=5,\n    options=pd.DataFrame(\n        {\n            \"first column\": [1, 2, 3, 4, 5],\n            \"second column\": [10, 20, 30, 40, 50],\n        }\n    ),\n)\nst.write(\"Value 4:\", w4)\n\nw5 = st.select_slider(\n    \"Label 5\",\n    value=(\"orange\", \"blue\"),\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    disabled=True,\n)\nst.write(\"Value 5:\", w5)\n\nw6 = st.select_slider(\n    \"Label 6\",\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    label_visibility=\"hidden\",\n)\n\nst.write(\"Value 6:\", w6)\n\n\nw7 = st.select_slider(\n    \"Label 7\",\n    options=[\"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"indigo\", \"violet\"],\n    label_visibility=\"collapsed\",\n)\n\nst.write(\"Value 7:\", w7)\n\nif runtime.exists():\n\n    def on_change():\n        st.session_state.select_slider_changed = True\n\n    st.select_slider(\n        \"Label 8\",\n        options=np.array([1, 2, 3, 4, 5]),\n        key=\"select_slider8\",\n        on_change=on_change,\n    )\n    st.write(\"Value 8:\", st.session_state.select_slider8)\n    st.write(\"Select slider changed:\", \"select_slider_changed\" in st.session_state)\n\nwith st.expander(\"Expander\", expanded=True):\n    w9 = st.select_slider(\n        label=\"Label 9\",\n        options=[\"foo\", \"bar\", \"baz\", \"This is a very, very long option\"],\n        value=\"This is a very, very long option\",\n    )\n\n    st.write(\"Value 9:\", w9)\n", "path": "e2e/scripts/st_select_slider.py"}]}