Skip to content

Bug - [ToolbarFilter] - [chipGroupContentRef.current is null] #10857

@ammont82

Description

@ammont82

Describe the problem
Using component in other component raise chipGroupContentRef.current is null exception in some cases.

How do you reproduce the problem?
Acess to this URL: https://console.redhat.com/openshift/assisted-installer/clusters and wait for a while. The error appears after some time.

Expected behavior
Not error shown in the page.

Is this issue blocking you?
Yes, I implement it a workaround to solve it: https://github.com/openshift-assisted/assisted-installer-ui/pull/2652/files#diff-9e34dbbb99bb6a4515f6f35e3ba200ac0d376f46e53f13f00ae66f777d1bd229 creating a CustomToolbarFilter component.

To solve this issue, if you go to https://github.com/patternfly/patternfly-react/blob/main/packages/react-core/src/components/Toolbar/ToolbarFilter.tsx#L137
and add this piece of code, it works:

  {chipGroupContentRef &&
            chipGroupContentRef.current !== null &&
            chipGroupContentRef.current.firstElementChild !== null &&
            ReactDOM.createPortal(chipGroup, chipGroupContentRef.current.firstElementChild)}

Screenshots
image

What is your environment?

  • Browser [chrome]
  • Version [Versión 127.0.6533.99 (Build oficial) (64 bits)]

What is your product and what release date are you targeting?
I'm using patternfly/react-core 5.2.0

Any other information?

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions