Skip to content

Bug - ExpandableSection - Uncaught exception on unmount #10410

@christianvogt

Description

@christianvogt

Describe the problem
Component: ExpandableSection
Requires property variant="truncate" in order to invoke the offending code.

Component throws an uncaught exception when mounting and unmounting quickly or after a resize event that schedules the resize callback handler.

Error:
Cannot destructure property 'offsetWidth' of 'this.expandableContentRef.current' as it is null.

This issue was first observed in our automated tests which performs UI actions quickly.

How do you reproduce the problem?
codesandbox demonstrating the problem.

  • Render an ExpandableSection with variant="truncate"
  • Unmount the component within <250ms of rendering.
  • Or unmount within <250ms of a resize event.

Expected behavior
No exception should occur. Component should clean up any scheduled callbacks when the component is unmounted.

Is this issue blocking you?
Yes it is blocking our automated tests.

Work around is to disable our tests that use this component.

What is your environment?

  • OS: macos
  • Browser: Chrome
  • Version: 125

What is your product and what release date are you targeting?
RHOAI 2.11

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions