Skip to content

ROX-33497: Fix checkbox select dropdowns in reporting UI#19324

Open
dvail wants to merge 1 commit intodv/ROX-28622-pf-6from
dv/ROX-33497-fix-checkbox-selects-in-reporting
Open

ROX-33497: Fix checkbox select dropdowns in reporting UI#19324
dvail wants to merge 1 commit intodv/ROX-28622-pf-6from
dv/ROX-33497-fix-checkbox-selects-in-reporting

Conversation

@dvail
Copy link
Contributor

@dvail dvail commented Mar 6, 2026

Description

The onBlur override added to this custom component was breaking the default functionality, so it was removed. PatternFly natively handles closing the <Select> menu when focus is removed from the element.

Instead of tapping into formik.onBlur to handle validation for the CheckboxSelect components, we use the third shouldValidate = true parameter of the async field change function.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Test checkbox selects and verify that the values are

applied immediately, and that formik validation occurs correctly on the components that previously used onBlur.

Screen.Recording.2026-03-06.at.11.57.17.AM.mov

Verify that day selection dropdowns are now working as expected:
image

@dvail
Copy link
Contributor Author

dvail commented Mar 6, 2026

This change is part of the following stack:

Change managed by git-spice.

@openshift-ci
Copy link

openshift-ci bot commented Mar 6, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 6, 2026

Images are ready for the commit at 3c0e60d.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-237-g3c0e60d225.

@dvail dvail force-pushed the dv/ROX-33497-fix-checkbox-selects-in-reporting branch from 427a12f to a04b174 Compare March 6, 2026 16:48

type CheckboxSelectWithArrayCallback = CheckboxSelectBaseProps & {
onChange: (selections: string[]) => void;
onItemSelect?: never;
Copy link
Contributor Author

@dvail dvail Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onItemSelect is not used by any instance of this component, so we can simplify this aspect as well.

@dvail dvail force-pushed the dv/ROX-33497-fix-checkbox-selects-in-reporting branch from a04b174 to 3c0e60d Compare March 6, 2026 16:51
@dvail dvail marked this pull request as ready for review March 6, 2026 17:00
@dvail dvail requested a review from a team as a code owner March 6, 2026 17:00
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dv/ROX-28622-pf-6@dac48f7). Learn more about missing BASE report.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             dv/ROX-28622-pf-6   #19324   +/-   ##
====================================================
  Coverage                     ?   49.56%           
====================================================
  Files                        ?     2675           
  Lines                        ?   201838           
  Branches                     ?        0           
====================================================
  Hits                         ?   100034           
  Misses                       ?    94347           
  Partials                     ?     7457           
Flag Coverage Δ
go-unit-tests 49.56% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ReactNode,
Ref,
} from 'react';
import { Children, cloneElement, isValidElement, useMemo, useState } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off the subject of this change:

  • This is the only PatternFly component that calls cloneElement function.
  • Classic Widget is the only other in the application.

shouldFocusToggleOnSelect
popperProps={popperProps}
>
<SelectList>{enhancedChildren}</SelectList>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another observation off the subject: although I suspect I have done it myself, providing SelectList element within component prevents caller to provide multiple of them if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants