Missing documentation for event type names in SDK

Offen
#415 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
documentation

Rechercherichtung

Start with the linked sap.ui.core.dnd.DropInfo event documentation for version 1.116 and compare it with the release-note guidance and the XML and controller examples in this issue. Reproduce the typing behavior around DropInfo$DropEvent and DragEvent, then update the relevant event-type documentation so the supported usage and expected event parameter type are explicit.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Hi,

Ever since 1.115 my team is having issues setting the correct type on events, There seems to be no up-to-date documentation or clear Types indaction;
For example before 1.115, this was correct:

XML:

<dragDropConfig>
     <dnd:DropInfo drop="onDropFile"/>
</dragDropConfig>

Controller

  onDropFile(event: Event) {
          const browserEvent = event.getParameter("browserEvent") as DragEvent;
          if (browserEvent.dataTransfer.files) {
              const files = browserEvent.dataTransfer.files;
              this.attachFiles(files);
          }
      }

After 1.115 this is no longer correct, but according to the documentation this is correct: https://ui5.sap.com/1.116.0/#/api/sap.ui.core.dnd.DropInfo%23events/drop

If we try to do it the suggested way according to the release notes we get ( I think this:
Controller

   onDropFile(event: DropInfo$DropEvent) {
        const browserEvent = event.getParameter("browserEvent") as DragEvent;
        if (browserEvent.dataTransfer.files) {
            const files = browserEvent.dataTransfer.files;
            this.attachFiles(files);
        }
    }

However there isn't any combination that works with DragEvent, and without documentation this just becomes a guesing game.

Is there something we are missing or is the documentation just not up-to-date?

Vorherrschende Sprache
TypeScript
Sterne
213
Forks
35
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

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 UI5/typescript

Alle Issues in UI5/typescript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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