Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tooltip shows text outside of the box when there are new lines in the help text #13339

@mzientek

Description

@mzientek

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

In the tool tips for st.markdown and st.caption, when there are new line characters in the help text, the text gets displayed next to the tool tip sign instead of inside it. Image of observed behavior.

Reproducible Code Example

Open in Streamlit Cloud

import streamlit as st

st.caption("Test",
    help="Tool tip with \n\n new lines"
)

st.markdown("Test",
    help="Tool tip with \n\n new lines"
)

Steps To Reproduce

No response

Expected Behavior

In Streamlit 1.51 (and prior) the text gets displayed correctly in the tooltip like so: Expected.pdf

Current Behavior

Text gets displayed next to the tool tip instead of inside it.

Is this a regression?

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

Debug info

  • Streamlit version: 1.52.1
  • Python version: 3.12.3
  • Operating System: Ubuntu on WSL
  • Browser: Firefox

Additional Information

No response

Metadata

Metadata

Assignees

Labels

feature:markdownRelated to Markdown renderingfeature:st.captionRelated to the `st.caption` elementfeature:tooltipRelated to tooltip displaypriority:P1High priority - fix within two weeksstatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedtype:regressionThis bug is a regression from previous behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions