Skip to content

Flickering icons #10

@Andre-Medina

Description

@Andre-Medina

When the page loads and before the icon has been drawn, the DashIconoify element width is 0px, then once the icon is drawn the width goes to e.g. 16px. This causes horizontal flickering.

            dmc.Button(
                children="label", 
                leftSection=DashIconify(icon=my_icon, height = 16, width =16),
                ),
            ), 

Buttons flicker (Note: each of these buttons redirects the page and reloads the icons):
icons flickering

I recommend, if the height or width kwargs are passed. To set the width/ heigh to that value of the Div before the icon is drawn. This will remove the flickering.

Adding div with constant width

            dmc.Button(
                children="label", 
                leftSection= html.Div(
                    DashIconify(icon=my_icon, height = 16, width =16),
                    style = {"width": "16px"}
                ),
            ), 

Flickering is removed:
icons not flickering

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions