From 82957ffe29dcf94dcb4ac04f1fca5c26e68246ef Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 07:58:20 +0000 Subject: [PATCH 1/3] fix(fields): the PeoplePicker's inline popover is modal, so its list scrolls inside a dialog Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB --- .../fields/src/widgets/PeoplePicker.test.tsx | 46 +++++++++++++++++++ .../fields/src/widgets/PeoplePicker.tsx | 7 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/ui/packages/fields/src/widgets/PeoplePicker.test.tsx b/ui/packages/fields/src/widgets/PeoplePicker.test.tsx index ee0974bb691..f703442d7fc 100644 --- a/ui/packages/fields/src/widgets/PeoplePicker.test.tsx +++ b/ui/packages/fields/src/widgets/PeoplePicker.test.tsx @@ -8,6 +8,7 @@ import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { Dialog, DialogContent, DialogTitle } from '@object-ui/components'; import { PeoplePicker } from './PeoplePicker'; import { pushRecentLookupId } from './recentLookups'; @@ -358,3 +359,48 @@ describe('PeoplePicker', () => { expect(onOpenChange).toHaveBeenCalledWith(false); }); }); + +/** + * The inline popover inside a dialog (objectstack#36852). Radix Dialog's + * scroll lock treats the dialog content as its only shard; the popover is + * portalled to the body, outside it, so a non-modal popover gets every wheel + * and touch move cancelled. `modal` makes the popover its own, topmost lock + * layer. jsdom does no scrolling, so the pin reads the observable half of + * `modal`: while the popover is open the dialog behind it is hidden from + * assistive technology. The scroll readings are on the pull request. + */ +describe('PeoplePicker inline popover inside a dialog', () => { + function renderInDialog(open: boolean) { + render( + + + Form + open} + dataSource={makeDataSource()} + onOpenChange={vi.fn()} + onSelect={vi.fn()} + /> + + , + ); + } + + it('while the popover is open, the dialog behind it is hidden (the popover is modal)', async () => { + renderInDialog(true); + const popover = await screen.findByTestId('people-picker-inline'); + await waitFor(() => expect(screen.getByText('Amy Lin')).toBeTruthy()); + expect(screen.getByTestId('host-dialog').closest('[aria-hidden="true"]')).not.toBeNull(); + expect(popover.closest('[aria-hidden="true"]')).toBeNull(); + }); + + it('CONTROL: with the popover closed, the dialog is not hidden', async () => { + renderInDialog(false); + const dialog = await screen.findByTestId('host-dialog'); + expect(screen.queryByTestId('people-picker-inline')).toBeNull(); + expect(dialog.closest('[aria-hidden="true"]')).toBeNull(); + }); +}); diff --git a/ui/packages/fields/src/widgets/PeoplePicker.tsx b/ui/packages/fields/src/widgets/PeoplePicker.tsx index c315561cbd8..29d231f3873 100644 --- a/ui/packages/fields/src/widgets/PeoplePicker.tsx +++ b/ui/packages/fields/src/widgets/PeoplePicker.tsx @@ -722,8 +722,13 @@ export function PeoplePicker({ ); } + // `modal`: the popover is its own scroll-lock layer. It is portalled out of + // a modal form's DOM, so a non-modal popover's list sits outside that + // dialog's scroll lock, which cancels every wheel and touch move on it; as + // the topmost lock its list scrolls. The same treatment as the lookup + // popover (objectstack#36825, #36852). return ( - + {trigger} Date: Tue, 24 Nov 2026 08:21:49 +0000 Subject: [PATCH 2/3] fix(fields): the PeoplePicker's list area is a flex column, so its list scrolls in a max-height container Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB --- .../fields/src/widgets/PeoplePicker.test.tsx | 18 +++++++++++++++--- .../fields/src/widgets/PeoplePicker.tsx | 8 ++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ui/packages/fields/src/widgets/PeoplePicker.test.tsx b/ui/packages/fields/src/widgets/PeoplePicker.test.tsx index f703442d7fc..c7814e6fb78 100644 --- a/ui/packages/fields/src/widgets/PeoplePicker.test.tsx +++ b/ui/packages/fields/src/widgets/PeoplePicker.test.tsx @@ -365,9 +365,15 @@ describe('PeoplePicker', () => { * scroll lock treats the dialog content as its only shard; the popover is * portalled to the body, outside it, so a non-modal popover gets every wheel * and touch move cancelled. `modal` makes the popover its own, topmost lock - * layer. jsdom does no scrolling, so the pin reads the observable half of - * `modal`: while the popover is open the dialog behind it is hidden from - * assistive technology. The scroll readings are on the pull request. + * layer. A second cause sat under it: the popover is capped by `max-h-*` + * only, so the list area's viewport (`h-full`) took its content height and + * the list was clipped, not scrolled; the list area is a flex column so the + * viewport shrinks to the room it is given. + * + * jsdom does no layout or scrolling, so the pins read the observable half of + * `modal` (while the popover is open the dialog behind it is hidden from + * assistive technology) and the list area's flex column; the wheel and touch + * readings are on the pull request. */ describe('PeoplePicker inline popover inside a dialog', () => { function renderInDialog(open: boolean) { @@ -397,6 +403,12 @@ describe('PeoplePicker inline popover inside a dialog', () => { expect(popover.closest('[aria-hidden="true"]')).toBeNull(); }); + it('the list area is a flex column, so its viewport shrinks to the popover and scrolls', async () => { + renderInDialog(true); + await waitFor(() => expect(screen.getByText('Amy Lin')).toBeTruthy()); + expect(screen.getByTestId('people-picker-list')).toHaveClass('flex', 'flex-col', 'min-h-0', 'flex-1'); + }); + it('CONTROL: with the popover closed, the dialog is not hidden', async () => { renderInDialog(false); const dialog = await screen.findByTestId('host-dialog'); diff --git a/ui/packages/fields/src/widgets/PeoplePicker.tsx b/ui/packages/fields/src/widgets/PeoplePicker.tsx index 29d231f3873..84e90069ac0 100644 --- a/ui/packages/fields/src/widgets/PeoplePicker.tsx +++ b/ui/packages/fields/src/widgets/PeoplePicker.tsx @@ -603,8 +603,12 @@ export function PeoplePicker({ )} - {/* Candidate area */} - + {/* Candidate area. `flex flex-col` makes the viewport a flex item that + shrinks to the room this area is given: a container capped only by + `max-h-*` (the inline popover, the desktop dialog) has no definite + height, so the viewport's own `h-full` falls back to its content + height and the list is clipped instead of scrolling. */} +
Date: Tue, 24 Nov 2026 08:31:43 +0000 Subject: [PATCH 3/3] chore(changeset): people picker list scrolls in a dialog Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB --- .changeset/36852-peoplepicker-dialog-scroll.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/36852-peoplepicker-dialog-scroll.md diff --git a/.changeset/36852-peoplepicker-dialog-scroll.md b/.changeset/36852-peoplepicker-dialog-scroll.md new file mode 100644 index 00000000000..6020ea87de7 --- /dev/null +++ b/.changeset/36852-peoplepicker-dialog-scroll.md @@ -0,0 +1,10 @@ +--- +'@object-ui/fields': patch +--- + +fix(fields): the people picker's list scrolls by wheel and touch inside a dialog, and in its desktop dialog + +Clause-②: no +Metadata-protocol: none + +A user field's inline people picker could not be scrolled when it was opened inside a dialog form. Two things held it. The dropdown is rendered outside the dialog, so the form dialog's scroll lock cancelled every wheel and touch move over it; the dropdown is now modal, its own scroll-lock layer, as the lookup dropdown already is. Under that, the list area took the full height of its rows instead of the room the dropdown gives it, so the rows past the bottom edge were clipped rather than scrollable, inside a dialog or not; the list now shrinks to that room and scrolls. The same list in the people picker's centred desktop dialog scrolls now too. While the inline dropdown is open, the page behind it is hidden from assistive technology and a click outside closes it first, as with the other dropdown menus. The phone's bottom sheet is unchanged.