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

Modifiers not applied on ChatMessage buttons #6300

Closed
1 task done
pierrotsmnrd opened this issue Feb 4, 2024 · 0 comments · Fixed by #6304
Closed
1 task done

Modifiers not applied on ChatMessage buttons #6300

pierrotsmnrd opened this issue Feb 4, 2024 · 0 comments · Fixed by #6304
Labels
type: bug Something isn't correct or isn't working

Comments

@pierrotsmnrd
Copy link
Collaborator

Software version info

  • panel 1.3.8
  • python 3.9.18

Description of expected behavior and the observed behavior

I'm using design modifiers to style a panel app (Ragna's UI).
I noticed that some modifiers were not applied to some widgets.
For instance, we have Button widgets in the UI, and some of them are inside ChatMessage objects.
The modifiers are applied for most of the buttons, except for the ones inside ChatMessage.

I don't know if this happens in other cases that ChatMessage.

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

import panel as pn

def index():

    standard_button = pn.widgets.Button(name="standard button")
    chat_message = pn.chat.ChatMessage(pn.widgets.Button(name="Button in chat message"))

    template = pn.template.FastListTemplate(title="bug with modifiers")
    template.main.append( pn.Column(standard_button, chat_message) )
    return template

pn.theme.fast.Fast.modifiers[pn.widgets.Button] = {
    "stylesheets": [" :host { background-color: red; }"]
}

pn.serve({"/":index})

Screenshots

This yields the following result, where we can see that only one button has a red background :

image

Looking at the generated code, we can see that the modifier is added to the first button, but not to the second :

Capture d’écran 2024-02-04 à 09 26 44

Capture d’écran 2024-02-04 à 09 27 08

  • I may be interested in making a pull request to address this
    I have actually started digging inside Panel, but I need help understanding what's going on.
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Feb 4, 2024
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