Skip to content

[openui5] Type regression: Menu$ItemSelectedEventParameters.item changed from MenuItem to IMenuItem #73952

Description

@edemuck4timbuktu

🐞 Issue Description

Since version 1.138 (DefinitelyTyped PR #73225
), the sap.m interface Menu$ItemSelectedEventParameters defines the property item with the type IMenuItem.
Before this PR, the property had the type sap.m.MenuItem.

As a result, when accessing the "item" event parameter in a handler, previous method calls (e.g., getBindingContext) no longer work.

💥 Example

public onDateEndCalculateMenuButtonItemSelected(event: Menu$ItemSelectedEvent): void {
    const bindingContext = event.getParameter("item")?.getBindingContext("dialog");
}

TypeScript output:

error TS2339: Property 'getBindingContext' does not exist on type 'IMenuItem'.

📋 Details

This issue occurs everywhere the IMenuItem interface is used instead of sap.m.MenuItem.
The IMenuItem interface currently only contains one property:

__implements__sap_m_IMenuItem

💡 Expected Behavior

The item event parameter should provide access to the same methods as before (e.g., getBindingContext), or IMenuItem should properly reflect the type definition of sap.m.MenuItem.

✅ Environment

Type Definitions: since @types/openui5 version 1.138

UI5 Library: sap.m

TypeScript: 5.9.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions