patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

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

Open ammont82 opened this issue 1 year ago • 1 comments

Describe the problem Using <ToolbarFilter> 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?

ammont82 avatar Aug 14 '24 13:08 ammont82

This might be a better screenshot of the error:

image

jgyselov avatar Aug 16 '24 09:08 jgyselov

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Oct 23 '24 11:10 github-actions[bot]

closed by #11223

tlabaj avatar Nov 20 '24 18:11 tlabaj