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.

Assessment

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

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.

Description

dts-generator

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.

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

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.

More from UI5/typescript

All issues in UI5/typescript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.