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

Tabulator value lookup editor in MaterialTemplate rendered without a background color #5003

Closed
Lnk2past opened this issue Jun 1, 2023 · 1 comment · Fixed by #5038
Closed
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@Lnk2past
Copy link
Contributor

Lnk2past commented Jun 1, 2023

ALL software version info

  • panel=1.0.4
  • bokeh=3.1.1

Description of expected behavior and the observed behavior

When setting up a Tabulator component with value lookup editors/header filters to be placed within a MaterialTemplate, the drop-down that is generated should inherit some of the values from the page CSS to make it viewable. Currently the MaterialTemplate does not nicely render the dropdown from header filters, as items have a transparent background.

All other templates render this correctly.

Complete, minimal, self-contained example code that reproduces the issue

# test.py
import pandas as pd
import panel as pn

pn.extension('tabulator')

editors = {
    'C': dict(type='list', valuesLookup=True, func='='),
}

tb = pn.widgets.Tabulator(
    pd.util.testing.makeMixedDataFrame(),
    editors=editors,
    header_filters=True
)

pn.template.MaterialTemplate(main=[tb]).servable()
panel serve test.py

It does not seem possible to add a style directly to the tabulator component to fix this using styles and stylesheets, as the drop down elements in the page are added as a child to the body instead of the tabulator div. I tried the following CSS (I am not too knowledgeable here, so maybe the selectors I am trying are incorrect) to set the background color directly with no success:

# ...
stylesheet = """
.tabulator-popup-container {
    background-color: white;
}

:root > .tabulator-popup-container {
    background-color: white;
}
"""
tb = pn.widgets.Tabulator(
    # ...
    stylesheets=[stylesheet]
)

However, I was able to fix with the no longer recommended approach:

css = '''
.tabulator-popup-container {
    background-color: white;
}
'''
pn.extension('tabulator', raw_css=[css])

Stack traceback and/or browser JavaScript console output

N/A

Screenshots or screencasts of the bug in action

N/A cannot provide at the moment.

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jun 1, 2023
@philippjfr philippjfr added this to the v1.0.5 milestone Jun 1, 2023
@philippjfr
Copy link
Member

Thanks for the detailed writeup @Lnk2past!

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