-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing documentation for event type names in SDK #415
Comments
Hi Eric, There are several aspects to this ticket and I'll try to address all of them: 1.) Just to explain the overall motivation (even though it might be clear to you already, anyway): 2.) The following code does not work and this is a bug: onDropFile(event: DropInfo$DropEvent) {
const browserEvent = event.getParameter("browserEvent") as DragEvent; The "browserEvent" parameter is typed as UI5 Event, hence TypeScript complains about the cast to the browser's onDropFile(event: DropInfo$DropEvent) {
const browserEvent = event.getParameter("browserEvent") as unknown as DragEvent; With this, the subsequent access to the 3.) For the rest I'm not totally clear what you mean: "[no] combination that works with DragEvent, and without documentation"... |
Thank you @akudev for the explination, for point 3: I was refering to problem above and the documentation in https://ui5.sap.com/1.116.0/#/api/sap.ui.core.dnd.DropInfo%23events/drop not matching the type indication. I understand what you try to achieve with the changes in 1.115, but without proper documentation a piece of code like |
Ok,... for problem 2.) a fix is on its way already. The more general problem, to rephrase it, is that the type names for the events are not documented anywhere, making it hard to know them, right? On the one hand we hoped that the consistent On the other hand I see why it would be better to simply have it explicitly written in the documentation. The challenges for this are:
Where it currently says |
A reference in the documentation would be a plus, however I think you explination with example allready clear enough (for me). |
"DragEvent" is more precise on the one hand, leading to a better TypeScript experience, and on the other hand avoids the issue that simply "Event" is somehow (wrongly) interpreted as UI5 event (should be a browser event). Related to SAP/ui5-typescript#415 Change-Id: I7be6df5ab541bc8a5ec47eb48cbbacbb60f115fe
Bug is fixed with SAP/openui5@43e032c for the 1.119 types. The general event name issue is still open. |
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:
Controller
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
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?
The text was updated successfully, but these errors were encountered: