[BUG] Upload component applying styles on Drag/Drop

Offen
#3,376 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
frontend

Rechercherichtung

Beginnen Sie mit der Reproduktion von dcc.Upload und seinen Einstellungen accept, style, style_active und style_reject und reproduzieren Sie anschließend das Drag-and-Drop-Verhalten in den gemeldeten Edge- und Firefox-Versionen. Als erledigt gilt die Aufgabe, wenn gültige .obj- und XLS/XLSX-Drops das aktive Styling anstelle des Reject-Rahmens anzeigen und ungültige Dateien weiterhin das Reject-Styling anzeigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

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

Vorherrschende Sprache
Python
Sterne
24.5k
Forks
2.3k
Ø Merge
3 T. 7 Std.
Gemergte PRs (30 T.)
30

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/dash

Alle Issues in plotly/dash

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.