UI5 / UI5/typescript

Missing documentation for event type names in SDK

Open
#415 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
213
Forks
35
Avg merge
37m
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.