UI5 / UI5/typescript

selectedItem property of Select$ChangeEventParameters should not be optional

Open Beginner friendly
#529 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

public async onChangeDimensionType(event: sap.m.Select$ChangeEvent) {
        const selectedItem = event.getParameter("selectedItem"); 
}

TS tells me that selectedItem might be undefined, which is wrong.

Expected behavior
Should return a selected item, as defined by the UI5 API reference.

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 at the Select$ChangeEventParameters type declaration and compare its selectedItem parameter with the UI5 API reference linked in the issue. Update the type so the shown onChangeDimensionType example no longer reports selectedItem as possibly undefined, then run the repository's relevant type checks or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.