AnnMarieW / dash-bootstrap-templates

A collection of 52 Plotly figure templates with a Bootstrap theme. Two theme switch components. Stylesheet to apply Bootstrap themes to Plotly Dash components.
https://hellodash.pythonanywhere.com/
MIT License
132 stars 24 forks source link

themes fail to fully apply when persistence in enabled for radio_props of ThemeChangerAIO #43

Open mayushii21 opened 4 days ago

mayushii21 commented 4 days ago

Example ThemeChangerAIO:

ThemeChangerAIO(
    aio_id="theme",
    radio_props={
        "options": [
            {
                "label": "Cyborg",
                "value": dbc.themes.CYBORG,
                "label_id": "theme-switch-label-dark",
            },
            {
                "label": "Vapor",
                "value": dbc.themes.VAPOR,
                "label_id": "theme-switch-label-dark",
            }
        ],
        "value": dbc.themes.CYBORG,
        "persistence": True,
    }
)

On the first load, the Cyborg theme is rendered, as expected. Switching to Vapor properly switches the theme to Vapor. Reloading the page, however, results in a theme somewhere in between Vapor and Cyborg, where the background is Vapor, but the text color, button borders, and other elements are Cyborg.

In version 1.1.2, things work properly (persisted themes get correctly applied after reload), but only in Chrome, not in Firefox. After version 1.1.2 the issue is present in Chrome as well.

Here is how things should look after reload (same as when freshly applying the theme): image image image

Here is how they look after reloading with version 1.1.2 in Firefox, and in Chrome as well with newer versions: image image image

AnnMarieW commented 4 days ago

Hi @mayushii21 Thanks for reporting... I'm looking into it :thinking: