Skip to content

fix(ui5-list): guard item-toggle against null event detail#13646

Open
plamenivanov91 wants to merge 1 commit into
mainfrom
list-onitemtoggle-fix
Open

fix(ui5-list): guard item-toggle against null event detail#13646
plamenivanov91 wants to merge 1 commit into
mainfrom
list-onitemtoggle-fix

Conversation

@plamenivanov91
Copy link
Copy Markdown
Contributor

Prevent runtime crashes when a bubbling ui5-toggle event reaches ui5-list with null detail (for example from nested components such as ui5-panel).

Update List.onItemToggle to safely read e.detail?.item and return early when no item is provided before firing ui5-item-toggle.

Add Cypress regression coverage in List.cy.tsx for null-detail toggle events and keep the nested panel scenario check.

Fixes: #13576

Prevent runtime crashes when a bubbling ui5-toggle event reaches ui5-list
with null detail (for example from nested components such as ui5-panel).

Update List.onItemToggle to safely read e.detail?.item and return early
when no item is provided before firing ui5-item-toggle.

Add Cypress regression coverage in List.cy.tsx for null-detail toggle
events and keep the nested panel scenario check.

Fixes: #13576
@sap-ui5-webcomponents-release
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[List]: Cannot read properties of null (reading 'item') in List.onItemToggle

1 participant