Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Fix popover dropdowns scrolling in Drawers/Dialogs (#921)
Chase Foster6b7a788fd98a
diff --git a/llm/cache/coding-conventions.md b/llm/cache/coding-conventions.mdindex b3dc056668..0e08abefbb 100644--- a/llm/cache/coding-conventions.md+++ b/llm/cache/coding-conventions.md@@ -129,6 +129,27 @@ const { client, companyId, userId } = await requirePermissions(request, {- Accessibility considerations (ARIA attributes)- Dark mode support via theme system+### Popover dropdowns inside Drawers/Dialogs must stop wheel propagation++`Combobox`, `CreatableCombobox`, `CreatableMultiSelect`, `MultiSelect`, and+`ChoiceSelect` (all in `packages/react/src/`) render their options list in a+`PopoverContent` portaled to `document.body`. The `Drawer` (`Drawer.tsx`) is a+Radix Dialog, which uses `react-remove-scroll` to lock background scrolling.+Because the popover is portaled outside the dialog subtree, the scroll-lock's+document-level wheel listener intercepts wheel/touch events over the dropdown+and the list's internal `overflow-auto` container cannot scroll (symptom: the+dropdown shows only the first ~6 options and won't scroll).++Fix/required pattern: add `onWheel={(e) => e.stopPropagation()}` and+`onTouchMove={(e) => e.stopPropagation()}` to the `PopoverContent` so the event+never reaches the scroll-lock listener. Any new popover-based dropdown with an+internal scroll area used inside a drawer/dialog must follow this pattern.++The list's scroll container should also carry+`scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent` (tailwind+scrollbar plugin) so a draggable scrollbar is visible even on platforms with+overlay scrollbars (macOS). All four dropdowns now use these classes.+## Theme SystemThemes are defined in `packages/utils/src/themes.ts` with CSS variables for colors. The user's selected theme is stored in the database and accessed via the `useTheme()` hook in `apps/erp/app/hooks/useTheme.tsx`.diff --git a/packages/react/src/Combobox.tsx b/packages/react/src/Combobox.tsxindex 2bad7ce1dd..5fe93b4656 100644--- a/packages/react/src/Combobox.tsx+++ b/packages/react/src/Combobox.tsx@@ -154,6 +154,8 @@ const Combobox = forwardRef<HTMLButtonElement, ComboboxProps>(</PopoverTrigger><PopoverContentalign="start"+ onWheel={(e) => e.stopPropagation()}+ onTouchMove={(e) => e.stopPropagation()}className="min-w-[var(--radix-popover-trigger-width)] max-w-[min(560px,calc(100vw-2rem))] p-1"style={{width: dropdownContentWidthChdiff --git a/packages/react/src/CreateableCombobox.tsx b/packages/react/src/CreateableCombobox.tsxindex 912f09d665..6a2f36a400 100644--- a/packages/react/src/CreateableCombobox.tsx+++ b/packages/react/src/CreateableCombobox.tsx@@ -162,6 +162,8 @@ const CreatableCombobox = forwardRef<HTMLButtonElement, CreatableComboboxProps>(</PopoverTrigger><PopoverContentalign="start"+ onWheel={(e) => e.stopPropagation()}+ onTouchMove={(e) => e.stopPropagation()}className="min-w-[var(--radix-popover-trigger-width)] max-w-[min(560px,calc(100vw-2rem))] p-1"style={{width: dropdownContentWidthChdiff --git a/packages/react/src/CreateableMultiSelect.tsx b/packages/react/src/CreateableMultiSelect.tsxindex 54f5d8fe73..8851b05573 100644--- a/packages/react/src/CreateableMultiSelect.tsx+++ b/packages/react/src/CreateableMultiSelect.tsx@@ -185,6 +185,8 @@ const CreatableMultiSelect = forwardRef<</PopoverTrigger><PopoverContentalign="end"+ onWheel={(e) => e.stopPropagation()}+ onTouchMove={(e) => e.stopPropagation()}className="min-w-[var(--radix-popover-trigger-width)] max-w-[min(560px,calc(100vw-2rem))] p-1"style={{width: dropdownContentWidthCh@@ -296,7 +298,7 @@ function VirtualizedCommand({/><divref={parentRef}- className="overflow-auto pt-1"+ className="overflow-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent pt-1"style={{height: `${Math.min(filteredOptions.length, 6) * itemHeight + 4}px`}}diff --git a/packages/react/src/MultiSelect.tsx b/packages/react/src/MultiSelect.tsxindex 84d2abd6f8..7778f0aa1e 100644--- a/packages/react/src/MultiSelect.tsx+++ b/packages/react/src/MultiSelect.tsx@@ -186,6 +186,8 @@ const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(</PopoverTrigger><PopoverContentalign="end"+ onWheel={(e) => e.stopPropagation()}+ onTouchMove={(e) => e.stopPropagation()}className="min-w-[var(--radix-popover-trigger-width)] p-1"><VirtualizedCommand@@ -271,7 +273,7 @@ function VirtualizedCommand({<CommandEmpty>{t`No option found.`}</CommandEmpty><divref={parentRef}- className="overflow-auto pt-1"+ className="overflow-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent pt-1"style={{height: `${Math.min(filteredOptions.length, 6) * itemHeight + 4}px`}}