Missing documentation for event type names in SDK

Abierto
#415 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
TypeScript
Estrellas
213
Forks
35
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de UI5/typescript

Todos los issues de UI5/typescript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.