Skip to content

[BUG] Upload component applying styles on Drag/Drop #3376

@Trevirirus

Description

@Trevirirus

When using Drag/Drop to place files into an Upload component accepting only .obj or .XLS (seperate inputs for both filetypes) Edge display always the error border on the upload. Firefox diplaying the error broder when the obj File into the input with the accepting file Type .obj.

Describe your context
Running on Windows with Python 3.12

dash                      3.1.0
dash-bootstrap-components 2.0.3
  • if frontend related, tell us your Browser, Version and OS

    • OS: Windows
    • Browser: Edge / Firefox
    • Version: 138.0.3351.95 / 128.12.0esr

Describe the bug

Wrong colors on input borders when dropping Files with correct Filetype (obj / XLSX) setting on Edge always "red" for all input files and types. On Firefox only setting red border style for obj files.

Expected behavior

Show specified color in style_active attribute of input component

dcc.Upload(
    id=f"{id_str}-upload-data",
    children=html.Div(
        [
            "Drag und drop oder klicken um Datei für upload auszuwählen."
        ]
    ),
    style={
        "width": "100%",
        "height": "60px",
        "borderWidth": "2px",
        "borderStyle": "solid",
        "borderRadius": "5px",
        "borderColor": "var(--bs-primary-border-subtle)",
        "textAlign": "center",
    },
    multiple=False,
    accept=file_extension,
    className="align-content-center",
    style_active={
        "borderStyle": "solid",
        "borderColor": "var(--bs-success)",
    },
    style_reject={
        "borderStyle": "solid",
        "borderColor": "var(--bs-danger)",
    },
),

File type get set as "text/csv,application/vnd.ms-excel" for XLS inputs and .obj

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions