Skip to content

Commit

Permalink
ensure markup panes wrap text in a row content
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Oct 23, 2024
1 parent 3ece2ec commit e8c576f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panel/styles/models/tabulator.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.tabulator-table {
max-width: 100%
max-width: 100%;

.tabulator-row .row-content .bk-panel-models-markup-HTML {
white-space: normal;
}
}
15 changes: 15 additions & 0 deletions panel/tests/ui/widgets/test_tabulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from panel.io.state import state
from panel.layout.base import Column
from panel.models.tabulator import _TABULATOR_THEMES_MAPPING
from panel.pane import Markdown
from panel.tests.util import get_ctrl_modifier, serve_component, wait_until
from panel.util import BOKEH_GE_3_6
from panel.widgets import Select, Tabulator, TextInput
Expand Down Expand Up @@ -4079,3 +4080,17 @@ def test_tabulator_header_tooltips(page):
page.wait_for_timeout(200)

expect(page.locator('.tabulator-tooltip')).to_have_text("Test")


def test_tabulator_row_content_markup_wrap(page):
# https://github.com/holoviz/panel/issues/7388

df = pd.DataFrame({"col": ["foo"]})
long_markdown = Markdown("xxxx " * 50)
widget = Tabulator(df, row_content=lambda row: long_markdown, expanded=[0], width=200)

serve_component(page, widget)

md = page.locator('.row-content .bk-panel-models-markup-HTML')

assert md.bounding_box()['height'] >= 130

0 comments on commit e8c576f

Please sign in to comment.