patternfly / patternfly/patternfly-react
Bug - DataViewFilters - childrenHash from JSON.stringify results in cyclic object value
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 862
- Forks
- 392
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 9
Description
Describe the problem
When using DataViewFilters with a child DataViewCheckboxFilter where the options have a label with a component (e.g. with an icon), the calculation of childrenHash via JSON.stringify results in a JavaScript cyclic object value error.
How do you reproduce the problem?
Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.
Expected behavior
I expect to be able to use a React component in the option labels. The goal is to render select list with options having icons and possibly tool tips.
Is this issue blocking you?
Worked around this by creating a copy of DataViewFilters in our project with a stricter set of properties provided to JSON.stringify [1].
Screenshots
Desired component:
What is your environment?
- OS: Fedora 43
- Browser: Firefox
- Version: 151
What is your product and what release date are you targeting?
StreamsHub Console [2] (user interface for Kafka clusters), planning to release in a week or so, likely with described work-around.
Any other information?
[1] https://github.com/MikeEdgar/streamshub-console/blob/418cb07cb05290e7d9be03ff67e39012d9b3095a/api/src/main/webui/src/components/common/DataViewFilters.tsx
[2] https://github.com/streamshub/console
Jira Issue: PF-4412
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DataViewFilters implementation and reproduce the cyclic object value using the linked CodeSandbox, with a child DataViewCheckboxFilter whose option label is a React component. Compare the behavior with the linked workaround and verify that component labels, including icons or tooltips, render without the JSON.stringify error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100