From 15e5bbe3f6d209bb80d01d7495ebc98dd92e44c0 Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Thu, 15 Oct 2026 18:13:34 +0200 Subject: [PATCH] fix(web): show onboarding Industry dropdown above the wizard scrim The Select dropdown is portaled to with z-50, under the wizard's z-[9999] scrim, so it was invisible yet clickable through the scrim. Lift it to z-[10000] and cover the stacking order with a test (UF-007). --- .../onboarding/WhoAreYouStep.test.tsx | 25 ++++++++++++++++++- .../os/overlays/onboarding/WhoAreYouStep.tsx | 5 +++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.test.tsx b/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.test.tsx index 4eb1654..b6a757c 100644 --- a/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.test.tsx +++ b/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, render, screen } from '@testing-library/react'; +import { cleanup, fireEvent, render, screen } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; import WhoAreYouStep from './WhoAreYouStep'; import type { OnboardingProfileFields } from './types'; @@ -50,4 +50,27 @@ describe('WhoAreYouStep', () => { expect(chip).toHaveClass('border-[var(--line-affordance)]'); } }); + + it('stacks the Industry dropdown above the onboarding scrim', async () => { + // The wizard scrim (.onboarding-scrim in OnboardingWizard.tsx) is z-[9999]. + // The dropdown is portaled to , so it must carry a higher z-index or + // it renders under the scrim while still receiving clicks. + const ONBOARDING_SCRIM_Z = 9999; + // jsdom has no scrollIntoView; Radix Select calls it on the focused option. + Element.prototype.scrollIntoView ??= vi.fn(); + render( + , + ); + + fireEvent.keyDown(screen.getByRole('combobox', { name: 'Industry' }), { key: 'Enter' }); + const listbox = await screen.findByRole('listbox'); + + const zClass = listbox.className.match(/(?:^|\s)z-\[?(\d+)\]?(?=\s|$)/); + expect(Number(zClass?.[1])).toBeGreaterThan(ONBOARDING_SCRIM_Z); + }); }); diff --git a/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.tsx b/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.tsx index 82ed135..27c9637 100644 --- a/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.tsx +++ b/apps/web/src/components/os/overlays/onboarding/WhoAreYouStep.tsx @@ -99,7 +99,10 @@ const WhoAreYouStep = ({ profile, onChange, onContinue, saving }: WhoAreYouStepP > - + {/* The dropdown is portaled to with the primitive's z-50, + which put it under the wizard's z-[9999] scrim: invisible, yet + clickable through the scrim. Lift it above the scrim. */} + {INDUSTRIES.map(i => ( {i} ))}