fix(Toolbar filter): Fixed null exception in Toolbar filter#12352
fix(Toolbar filter): Fixed null exception in Toolbar filter#12352tlabaj wants to merge 1 commit intopatternfly:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR fixes a null reference regression in ToolbarFilter by adding null-safety checks to portal target derivations in both collapsed and expanded rendering states, and includes test coverage for edge cases where refs may be null. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview: https://pf-react-pr-12352.surge.sh A11y report: https://pf-react-pr-12352-a11y.surge.sh |
What: Closes #12267
Summary
Fixes a crash in
ToolbarFilterwhen label portal targets are missing or not yet mounted (#12267).Changes
labelGroupContentRef.current.firstElementChildresolves to a real node (fixes incorrect!== nullchecks vsundefined).labelContainerRefso default / unset context does not throw on first render.Tests
ToolbarFilter.test.tsxfor default context andlabelGroupContentRef.current === nullwhile collapsed.Summary by CodeRabbit
Bug Fixes
Tests