plotly / plotly/dash

[BUG] Upload component applying styles on Drag/Drop

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

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Python
Sterne
24.4k
Forks
2.3k
Ø Merge
2 T. 7 Std.
Gemergte PRs (30 T.)
13

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

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.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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