Skip to content

fix: make demographics race "Decline to respond" option exclusive#6317

Open
youhaowei wants to merge 1 commit into
bloom-housing:mainfrom
youhaowei:2884/demographics-race-exclusive
Open

fix: make demographics race "Decline to respond" option exclusive#6317
youhaowei wants to merge 1 commit into
bloom-housing:mainfrom
youhaowei:2884/demographics-race-exclusive

Conversation

@youhaowei

Copy link
Copy Markdown

Issue

Closes #2884

On the application demographics step, the race question allowed "Decline to respond" to be selected at the same time as other race options. It should be mutually exclusive — the same exclusive-checkbox behavior already used in the application preferences/programs step.

Change

sites/public/src/pages/applications/review/demographics.tsx:

  • Checking "Decline to respond" clears every other race option.
  • Checking any other race option clears "Decline to respond".
  • Reuses the shared setExclusive helper (shared-helpers/.../multiselectQuestions.tsx) that powers the same behavior in ApplicationMultiselectQuestionStep. The per-field onChange is wired through FieldGroup's existing inputPropsFieldGroup itself is unchanged.

Testing

  • New unit tests in demographics.test.tsx cover both directions of exclusivity; full demographics suite is 14/14 passing.
  • Manually verified in a browser on the running demographics step — checking "Decline to respond" clears selected race options, and checking another option clears "Decline to respond".
  • tsc, ESLint, and Prettier are clean.

Known issue — not fixed here, needs discussion

FieldGroup (in @bloom-housing/ui-components) decides sub-option visibility from an internal click-tracked array (checkedInputs) rather than from form state. Because this fix unchecks options programmatically via setValue (which fires no click event), a parent option's sub-options stay visually expanded after the parent is cleared by the exclusive logic — e.g. expand "Asian", then check "Decline to respond": "Asian" and its sub-options uncheck correctly, but the sub-option rows remain on screen until the next interaction.

  • Checked state and submitted data are correct — this is purely visual.
  • It only occurs on the programmatic uncheck path; a normal user click still collapses sub-options correctly.
  • Root cause is in ui-components FieldGroup and affects every consumer. The proper fix is to derive sub-option visibility from watched form state instead of the click-tracked mirror. That is a cross-repo change and is left for team discussion on how best to handle.

🤖 Generated with Claude Code

@netlify

netlify Bot commented May 18, 2026

Copy link
Copy Markdown

👷 Deploy request for partners-bloom-msq2 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 52d6709

@netlify

netlify Bot commented May 18, 2026

Copy link
Copy Markdown

👷 Deploy request for bloom-angelopolis pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 52d6709

The race question on the application demographics step allowed "Decline
to respond" to be selected alongside other race options. Wire the race
FieldGroup so checking "Decline to respond" clears all other race
options, and checking any other option clears "Decline to respond",
reusing the shared setExclusive helper that powers the same behavior in
the application preferences/programs step.

Closes bloom-housing#2884

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@youhaowei youhaowei force-pushed the 2884/demographics-race-exclusive branch from 3ef43b8 to 52d6709 Compare May 18, 2026 05:51
@youhaowei

Copy link
Copy Markdown
Author

Re-triggering CI — the failures are in submit-application.spec.ts (unhandled auth-client error at the address step, before demographics) and map-address-popup (map view flake). Both are unrelated to this PR's changes. Re-running.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demographics race checkbox set decline should be exclusive

1 participant