- Updated design documentation to reflect the new Playwright-first approach for frontend testing, including orchestration flow and runbook notes. - Revised requirements to align with the new frontend test iteration strategy, emphasizing E2E environment management and coverage thresholds. - Expanded tasks to outline phased implementation for frontend testing, including Playwright E2E baseline, backend triage, and coverage validation. - Enhanced QA report to capture frontend coverage failures and type errors, with detailed remediation steps for accessibility compliance. - Created new security validation and accessibility remediation reports for CrowdSec configuration, addressing identified issues and implementing fixes. - Adjusted package.json scripts to prioritize Firefox for Playwright tests. - Added canonical links for requirements and tasks documentation.
4.5 KiB
Dropdown Menu Item Click Handlers - FIX COMPLETED
Problem Summary
Users reported that dropdown menus in ProxyHostForm (specifically ACL and Security Headers dropdowns) opened but menu items could not be clicked to change selection. This blocked users from configuring security settings and preventing remote Plex access.
Root Cause: Native HTML <select> elements render their dropdown menus outside the normal DOM tree. The modal container had pointer-events-none CSS property applied to manage z-index layering, which blocked browser-native dropdown menus from receiving click events.
Solution Implemented
Replaced all native HTML <select> elements with Radix UI Select component, which uses a portal to render the dropdown menu outside the DOM constraint and explicitly manages pointer events and z-index.
Changes Made
1. AccessListSelector.tsx
Before: Used native <select> element
After: Uses Radix UI Select, SelectTrigger, SelectContent, SelectItem
// Before
<select
id="access-list-select"
value={value || 0}
onChange={(e) => onChange(parseInt(e.target.value) || null)}
className="w-full bg-gray-900 border border-gray-700..."
>
<option value={0}>No Access Control (Public)</option>
{accessLists?.filter(...).map(...)}
</select>
// After
<Select value={String(value || 0)} onValueChange={(val) => onChange(parseInt(val) || null)}>
<SelectTrigger className="w-full bg-gray-900 border-gray-700 text-white">
<SelectValue placeholder="Select an ACL" />
</SelectTrigger>
<SelectContent>
<SelectItem value="0">No Access Control (Public)</SelectItem>
{accessLists?.filter(...).map(...)}
</SelectContent>
</Select>
2. ProxyHostForm.tsx
Replaced 6 native <select> elements with Radix UI Select component:
- Connection Source dropdown (Docker/Local selection)
- Containers dropdown (quick Docker container selection)
- Base Domain dropdown (auto-fill)
- Forward Scheme dropdown (HTTP/HTTPS)
- SSL Certificate dropdown
- Security Headers Profile dropdown
- Application Preset dropdown
All selects now use the Radix UI Select component with proper portal rendering.
3. Imports
Added Radix UI Select component imports to both files:
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from './ui/Select'
Technical Details
Why Radix UI Select is better for modals:
- Portal Rendering: Uses
SelectPrimitive.Portalto render menu outside DOM constraints - Z-index Management: Explicitly sets
z-50on content with proper layering - Pointer Events: Uses Radix's internal event system that bypasses CSS
pointer-eventsconstraints - Better Accessibility: Built with ARIA roles and keyboard navigation
- Consistent Behavior: Works reliably across browsers and with complex styling
Verification
✅ TypeScript compilation: PASSED (no errors) ✅ ESLint validation: PASSED (no errors) ✅ Component imports: CORRECT ✅ Event handlers: FUNCTIONAL
Testing
Created test file: tests/proxy-host-dropdown-fix.spec.ts
Tests verify:
- ✅ ACL dropdown can be opened and items are clickable
- ✅ Security Headers dropdown can be opened and items are clickable
- ✅ All dropdowns allow clicking menu items without blocking
- ✅ Selections register and persist
User Impact
Before Fix:
- ❌ Users could open dropdowns
- ❌ Clicks on menu items were blocked
- ❌ Could not select ACL or Security Headers
- ❌ Could not configure security settings
- ❌ Blocked remote Plex access
After Fix:
- ✅ Users can open dropdowns
- ✅ Clicks on menu items register properly
- ✅ Can select ACL options
- ✅ Can select Security Headers profiles
- ✅ Can configure all security settings
- ✅ Remote Plex access can be properly configured
Files Modified
/projects/Charon/frontend/src/components/AccessListSelector.tsx/projects/Charon/frontend/src/components/ProxyHostForm.tsx
Rollback Plan
If issues occur, revert to native <select> elements, but note that the root cause (pointer-events-none on modal) would need to be addressed separately:
- Option A: Remove
pointer-events-nonefrom modal container - Option B: Continue using Radix UI Select (recommended)
Notes
- The Radix UI Select component was already available in the codebase (ui/Select.tsx)
- No new dependencies were required
- All TypeScript types are properly defined
- Component maintains existing styling and behavior
- Improvements to accessibility as a side benefit