Issue Description:
Text overlap/rendering issue in st.expander() where widget key values appear to be rendered on top of the expander title text, causing "key_arrow_down” and “key_arrow_right” to overlap with the actual title text.
Environment Information:
• Streamlit Version: 1.47.0
• Python Version: 3.11 (Snowflake Streamlit environment)
• Platform: Snowflake Streamlit in Snowsight
• OS: Linux (Snowflake managed environment)
Minimal Reproducible Code:
import streamlit as st
\# This expander shows text overlap issue where auto-generated
\# widget keys appear on top of the title text
with st.form("test_form"):
st.subheader("🔧 Deployment Components")
st.markdown("\*Select which components to deploy\*")
comp_col1, comp_col2 = st.columns(2)
with comp_col1:
deploy_standard_objects = st.checkbox(
"Standard Objects",
value=True,
help="Deploy standard roles, warehouses, and databases"
)
deploy_audit_config = st.checkbox(
"Audit Configuration",
value=True,
help="Set up event tables and monitoring infrastructure"
)
with comp_col2:
deploy_security_policies = st.checkbox(
"Security Policies",
value=True,
help="Deploy network policies and authentication settings"
)
deploy_scim_integration = st.checkbox(
"SCIM Integration",
value=False,
help="Enable automated user provisioning"
)
\# THIS EXPANDER SHOWS THE TEXT OVERLAP ISSUE
with st.expander("ℹ️ \*\*What gets deployed?\*\*", expanded=False):
st.markdown("""
\*\*Standard Objects:\*\*
- Core roles (SYSADMIN, ACCOUNTADMIN, etc.)
- Compute warehouses (DEPLOYMENT_WH, ANALYTICS_WH)
- Standard databases and schemas
\*\*Audit Configuration:\*\*
- Event tables for access and query logging
- Audit streams for real-time monitoring
- Compliance reporting views
""")
\# Form submit button
submitted = st.form_submit_button("Generate Configuration", type="primary")
\# Minimal test case - plain text only
with st.expander("What gets deployed?", expanded=False):
st.markdown("Test content")
Observed Behavior:
• Auto-generated widget key text (like "key_arrow_down” and “key_arrow_right”) appears overlaid/overlapping with the expander title
• The expander title shows both the intended text “What gets deployed?” AND the key value simultaneously
• Text rendering appears corrupted with multiple strings displayed in the same location
Expected Behavior:
• Only the expander title “
What gets deployed?” should be visible
• No auto-generated key values should be rendered in the UI
• Clean, non-overlapping text display
Additional Context:
• Issue occurs specifically within st.form() context
• Multiple widgets (checkboxes, columns) are present before the expander
• Issue persists regardless of emoji usage or markdown formatting in title
• Attempted workaround with explicit key parameter fails because st.expander() doesn’t support key parameter in Streamlit 1.47.0
Visual Evidence:
According to user testing with CoCo analysis, the rendered output shows:
• "key_arrow_down” and “key_arrow_right” text overlapping with “What gets deployed?”
• Both strings visible simultaneously in the expander header area
• Suggests internal widget key generation is being incorrectly rendered to UI
Screenshot:
