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

layout='fit_data_stretch' on Tabulator does not work in modal #6353

Closed
wara6 opened this issue Feb 15, 2024 · 1 comment · Fixed by #6355
Closed

layout='fit_data_stretch' on Tabulator does not work in modal #6353

wara6 opened this issue Feb 15, 2024 · 1 comment · Fixed by #6355
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@wara6
Copy link

wara6 commented Feb 15, 2024

Setting layout to 'fit_data_stretch' for a tabulator inside a modal does not work.

Here's an example showing the behavior :

import panel as pn
import pandas as pd

df = pd.DataFrame([["this is a long long long long line" for k in range(8)] for i in range(10)], columns=list("ABCDEFGH"))

ui = pn.template.VanillaTemplate()
b = pn.widgets.Button(name="click me")
b.on_click(lambda e: ui.open_modal())
ui.main.append(b)
ui.modal.append(pn.widgets.Tabulator(df, layout='fit_data_stretch'))

ui.servable()

this shows (the dataframe content is not stretched and goes out of the modal) :
image

I tried a work around with fixing the width of each columns but it does not shows the full content of the strings because the text is not wrapping itself into various lines.

maybe related to stretch issue in #6344 ?
reproduced with panel 1.3.8

@philippjfr philippjfr added this to the v1.4.0 milestone Feb 15, 2024
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Feb 15, 2024
@wara6
Copy link
Author

wara6 commented Feb 16, 2024

Again in modal, restricting a tabulator's height and width together is broking the long line display.

Here's a screenshot with height and width setted :
image

The expected behavior would be to have these 2 combined, with 2 scrolling bars so (first display is with width restricted and second with height) :
image
image

here's the code of the first screenshot :

import panel as pn
import pandas as pd

df = pd.DataFrame([["this is a long long long long long long line"for x in range(8)] for i in range(15)])
ui = pn.template.VanillaTemplate()
b = pn.widgets.Button(name="open modal")
b.on_click(lambda e : ui.open_modal())
ui.main.append(b)
ui.modal.append(
    pn.widgets.Tabulator(
        df, height=300, width=1000))
ui.servable()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants