Skip to content

Commit 47ed85d

Browse files
fix(fields): lookup quick-create stays whole and clickable in a short popover; its list scrolls in dialogs (#36844)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTDAJKyXUan6fJCKsZUf5Pv)_ Fixes #36825 repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在弹窗里打开查找选择器时,「+ 新建」和「查看全部结果」固定在下拉底部,无论下拉多矮都完整可点;弹窗里的下拉列表也能用滚轮和手指滚动了。 - 为什么做:产品负责人在「新建商机产品明细」弹窗里点「产品」时,「+ 新建」只露出半行、点不到,列表也滚不动(最高优先级)。 - 出错会怎样:最坏是下拉打开时点页面别处需要先点一下关掉下拉,或屏幕阅读器暂时读不到下拉后面的页面;可整体撤回这一个提交。 - 要你做什么:无 ## What changes Confirmed cause, reproduced before any code change (desktop, Chromium, a lookup in a Radix `Dialog` built from `MobileDialogContent`, the 450px-high window of the report's shape, 1 recent + 2 results, readings below): 1. **The create row was the last child of the list's scroll container.** The popover is held to `--radix-popover-content-available-height`; when that room is shorter than the list, the list (`min-h-0`) is what shrinks, so the rows at its end are cut first. Measured: popover opened upwards with 270px of room (natural height 306px), the listbox ended at y=269 while the create row spanned y=266-302, so 3px of it showed and a hit test at its centre landed elsewhere. 2. **Inside a modal form the list could not be scrolled to it.** Radix Dialog mounts `react-remove-scroll` on its overlay with the dialog content as the only shard. The popover portals to `document.body`, outside that shard, so the lock's document-level `wheel` / `touchmove` listener takes the isolation branch and calls `preventDefault` on every move over the popover. Measured: 5 wheel ticks over the list, `scrollTop` 0 before and after, every wheel event prevented, while the same list outside a dialog scrolled 1080px. The fix, in `ui/packages/fields/src/widgets/LookupField.tsx` only: - quick-create and "show all results" move out of the scroll container into a footer pinned under the list (`lookup-panel-footer`): one row, create on the left (a long typed name truncates), "show all" on the right. The list gives way, the footer does not, on either side the popover opens to. The footer reads the unchanged `canCreate`; with nothing to create and nothing more to show it is not drawn; an empty result keeps its centred create button inside the list. - the popover is `modal`, its own scroll-lock layer (top of the lock stack, its content the lock's own tree), so wheel and touch scroll its list inside a dialog. Consumption of an existing Radix prop, no change in `@object-ui/components`. - the list cell's editor (`inCell`) is unchanged: it keeps both rows at the end of its list. Behaviour that comes with `modal`, the same as Radix `Select` and `DropdownMenu` already do here: while the popover is open the page behind it is `aria-hidden`, focus stays in the popover (Escape closes it), and a click outside closes the popover before it reaches what it landed on. ## Tests - New `LookupField.createPinned-36825.test.tsx`: long list (create and "show all" in the footer, outside the listbox), CONTROL short list (the same footer), no create grant and nothing to show (no footer), no grant with more to show ("show all" alone), empty result (centred create, no footer), ↑/↓ reach the last option with `aria-activedescendant` inside the listbox, and the page behind an open popover is hidden (the observable half of `modal`). - `LookupField.createGrant-12082.test.tsx`: two rows added, the footer offers "Create new" only with the target's create grant. - `LookupField.pickedLabel-10559.test.tsx`: its chip read now passes `hidden: true`, because it reads the chip while the (now modal) dropdown is open; the assertion is unchanged. - jsdom/happy-dom do no layout, so the unit pins hold the structure; the geometry is the browser readings below. No Playwright geometry spec was added in `ui/e2e/` (outside this card's file surface). - Package suite, gates and one ablation per new pin: readings in the os-dev-report comment on this PR, with the head sha they were taken on. ## Acceptance notes - Same mechanism, not changed here: the search-first lookup variant's desktop popover (`PeoplePicker` inline) is non-modal too and would be scroll-locked in a dialog the same way; not measured, out of this card's fence. - The phone face (touch scroll in the mobile create dialog, a bottom drawer) is the sibling card 36832, built on top of this change. ## Verification Read first: `LookupField.tsx` around `pinnedFooter` (the footer gate) and the `modal` Popover (the behaviour change). Two minutes: open any create dialog with a lookup near its bottom on a short window, open the lookup: 「+ 新建」 sits whole under a divider at the popover's bottom and the list scrolls with the wheel. <details><summary>Browser readings (harness: Dialog + MobileDialogContent + LookupField, zh-Hans, 1280 wide)</summary> | case | side | popover y | listbox y | create y | create whole / hit | wheel scrollTop | |---|---|---|---|---|---|---| | before, 450 high, 1 recent + 2 | top | 0-270 | 49-269 | 266-302 (in list) | no / no | 0 to 0 of 37 | | after, same | top | 0-270 | 49-224 | 229-265 (footer) | yes / yes | 0 to 46 of 46 | | after, 600 high, 25 of 60 | top | 130-481 | 179-435 | 440-476 (footer) | yes / yes | 0 to 1000 of 1080 | | after, 800 high, ample room (CONTROL) | bottom | 485-801 | 534-755 | 760-796 (footer) | yes / yes | fits | Screenshots are kept in the dev's scratchpad (the relay takes no uploads). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufziG2t1d9cfRQJDrHkB)_ <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7a7ab47 commit 47ed85d

5 files changed

Lines changed: 279 additions & 30 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/fields': patch
3+
---
4+
5+
fix(fields): a lookup's quick-create and "show all results" stay whole and clickable in a short popover, and its list scrolls inside a dialog
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The lookup popover drew its quick-create row and its "show all results" row as the last children of the scrolling option list. The popover is held to the room the browser leaves on the side it opens to, and when that room is shorter than the list the list shrinks, so those two rows were the first thing cut: in a dialog near the bottom of a short window the create row showed only its top edge and could not be clicked. Inside a modal form the list could not be scrolled to it either, because the form dialog's scroll lock cancelled every wheel and touch move on the popover, which is rendered outside the dialog.
11+
12+
Both rows now sit in a footer pinned under the list, quick-create on the left and "show all results" on the right, and the list is what gives way. The footer shows quick-create only when the field offers it and the user may create the target record, the same rule as before; when there is nothing to create and nothing more to show, no footer is drawn. A search with no match keeps its centred create button. The popover is now modal, its own scroll-lock layer, so its list scrolls by wheel and touch inside a dialog; while it 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 list cell's editor keeps both rows at the end of its list.

‎ui/packages/fields/src/widgets/LookupField.createGrant-12082.test.tsx‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,27 @@ describe('LookupField "Create new" reads the target object\'s create grant (obje
124124
expect(await offersCreateNew(null)).toBe(true);
125125
});
126126
});
127+
128+
/** Open the picker on a target that HAS candidates and report whether the pinned footer offers "Create new". */
129+
async function footerOffersCreateNew(perms: MePermissionsResponse | null): Promise<boolean> {
130+
const ds = makeDataSource();
131+
ds.find.mockResolvedValue({ data: [{ id: 'ct_1', name: 'NDA' }, { id: 'ct_2', name: 'MSA' }], total: 2 });
132+
const widget = <LookupField field={field} value={undefined} onChange={vi.fn()} readonly={false} dataSource={ds as any} />;
133+
render(perms ? <MePermissionsProvider initialPermissions={perms}>{widget}</MePermissionsProvider> : widget);
134+
await act(async () => {
135+
fireEvent.click(screen.getByRole('button', { name: /Select/i }));
136+
});
137+
await waitFor(() => expect(screen.getAllByRole('option')).toHaveLength(2));
138+
const footer = screen.queryByTestId('lookup-panel-footer');
139+
return footer !== null && footer.textContent!.includes('Create new');
140+
}
141+
142+
describe('the pinned footer reads the same create grant (objectstack#36825)', () => {
143+
it('create denied on the target → no "Create new" in the footer', async () => {
144+
expect(await footerOffersCreateNew(envelope({ allowCreate: false }))).toBe(false);
145+
});
146+
147+
it('CONTROL — create granted on the target → the footer offers "Create new"', async () => {
148+
expect(await footerOffersCreateNew(envelope({ allowCreate: true }))).toBe(true);
149+
});
150+
});
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/**
2+
* ObjectUI
3+
* Copyright (c) 2024-present ObjectStack Inc.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
/**
10+
* The lookup popover's quick-create and "show all results" stay whole and
11+
* clickable whatever room the popover gets (objectstack#36825).
12+
*
13+
* ## The defect
14+
*
15+
* Both rows were the last children of the option list's scroll container. The
16+
* popover is held to the room Radix reports on the side it opens to, and when
17+
* that room is short of the list's natural height the list is what shrinks, so
18+
* the rows at its end were the first thing cut: measured in a dialog on a
19+
* 450px-high window, the list ended 3px into the create row. Inside a modal
20+
* form the list could not be scrolled to it either, because the popover is
21+
* portalled out of the dialog's DOM and the dialog's scroll lock cancels every
22+
* wheel and touch move outside it.
23+
*
24+
* ## What holds it now
25+
*
26+
* - the two rows sit in a footer pinned under the list, outside its scroll
27+
* container, so the list gives way and they do not;
28+
* - the popover is `modal`, its own scroll-lock layer, so its list scrolls
29+
* inside a modal form.
30+
*
31+
* jsdom and happy-dom do no layout, so these pins hold the structure that
32+
* makes the geometry true; the geometry itself was measured in a browser
33+
* (the readings are on the pull request).
34+
*
35+
* ## The rows
36+
*
37+
* - a long list (the clipped case): create and "show all" are in the footer,
38+
* not in the listbox;
39+
* - CONTROL, a short list with room to spare: the footer is drawn the same
40+
* way, so the placement does not depend on the list's length;
41+
* - no create grant and nothing more to show: no footer at all;
42+
* - no matching option: the empty state keeps its centred create button and
43+
* draws no footer;
44+
* - ↑/↓ still reach the last option and `aria-activedescendant` names an
45+
* option inside the listbox;
46+
* - while the popover is open the page behind it is hidden from assistive
47+
* technology, the observable half of `modal`.
48+
*/
49+
import { render, screen, fireEvent, waitFor, act, cleanup, within } from '@testing-library/react';
50+
import '@testing-library/jest-dom';
51+
import React from 'react';
52+
import { describe, it, expect, vi, afterEach } from 'vitest';
53+
import { MePermissionsProvider, type MePermissionsAuthenticatedResponse } from '@object-ui/permissions';
54+
import { LookupField } from './LookupField';
55+
56+
afterEach(cleanup);
57+
58+
const TARGET = 'crm_account';
59+
60+
const field = {
61+
name: 'account',
62+
label: 'Account',
63+
reference: TARGET,
64+
reference_field: 'name',
65+
} as any;
66+
67+
function makeDataSource(shown: number, total: number) {
68+
const rows = Array.from({ length: total }, (_, i) => ({ id: `acc_${i + 1}`, name: `Account ${String(i + 1).padStart(2, '0')}` }));
69+
return {
70+
find: vi.fn().mockImplementation(async (_object: string, params: any) => {
71+
const q = String(params?.$search ?? '').trim();
72+
const hit = q ? rows.filter((r) => r.name.includes(q)) : rows;
73+
return { data: hit.slice(0, shown), total: hit.length };
74+
}),
75+
findOne: vi.fn(),
76+
create: vi.fn(),
77+
update: vi.fn(),
78+
delete: vi.fn(),
79+
};
80+
}
81+
82+
const deniedCreate: MePermissionsAuthenticatedResponse = {
83+
authenticated: true,
84+
userId: 'u-reader',
85+
tenantId: null,
86+
hasAnyQueue: false,
87+
objectsUsingQueues: [],
88+
positions: ['reader'],
89+
permissionSets: ['reader'],
90+
objects: { [TARGET]: { allowRead: true, allowCreate: false, allowEdit: false, allowDelete: false } },
91+
fields: {},
92+
};
93+
94+
async function openPicker(shown: number, total: number, wrap?: (node: React.ReactElement) => React.ReactElement) {
95+
const ds = makeDataSource(shown, total);
96+
const widget = <LookupField field={field} value={undefined} onChange={vi.fn()} readonly={false} dataSource={ds as any} />;
97+
const utils = render(
98+
<div>
99+
<button type="button">Outside the field</button>
100+
{wrap ? wrap(widget) : widget}
101+
</div>,
102+
);
103+
await act(async () => {
104+
fireEvent.click(screen.getByTestId('lookup-trigger-account'));
105+
});
106+
const popover = await screen.findByTestId('lookup-popover');
107+
if (shown > 0) await waitFor(() => expect(within(popover).getAllByRole('option')).toHaveLength(shown));
108+
return { ...utils, popover, listbox: within(popover).getByRole('listbox') };
109+
}
110+
111+
describe('LookupField popover pins quick-create and "show all" under the list (objectstack#36825)', () => {
112+
it('a long list (the clipped case): create and "show all" sit in the footer, outside the listbox', async () => {
113+
const { popover, listbox } = await openPicker(25, 60);
114+
const footer = within(popover).getByTestId('lookup-panel-footer');
115+
const create = within(footer).getByTestId('lookup-create-new');
116+
const showAll = within(footer).getByTestId('show-all-results');
117+
expect(create).toHaveTextContent(/Create new/);
118+
expect(showAll).toHaveTextContent(/60/);
119+
expect(listbox).not.toContainElement(create);
120+
expect(listbox).not.toContainElement(showAll);
121+
// The footer follows the list, a sibling of its scroll container's box.
122+
expect(listbox.compareDocumentPosition(footer) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
123+
expect(footer).not.toContainElement(listbox);
124+
});
125+
126+
it('CONTROL — a short list with room to spare draws the same footer', async () => {
127+
const { popover, listbox } = await openPicker(3, 3);
128+
const footer = within(popover).getByTestId('lookup-panel-footer');
129+
const create = within(footer).getByTestId('lookup-create-new');
130+
expect(listbox).not.toContainElement(create);
131+
// Nothing more to show: no "show all", anywhere.
132+
expect(within(popover).queryByTestId('show-all-results')).toBeNull();
133+
});
134+
135+
it('no create grant and nothing more to show: no footer', async () => {
136+
const { popover } = await openPicker(3, 3, (node) => (
137+
<MePermissionsProvider initialPermissions={deniedCreate}>{node}</MePermissionsProvider>
138+
));
139+
expect(within(popover).queryByTestId('lookup-panel-footer')).toBeNull();
140+
expect(within(popover).queryByText(/Create new/)).toBeNull();
141+
});
142+
143+
it('no create grant, more to show: the footer holds "show all" alone', async () => {
144+
const { popover } = await openPicker(25, 60, (node) => (
145+
<MePermissionsProvider initialPermissions={deniedCreate}>{node}</MePermissionsProvider>
146+
));
147+
const footer = within(popover).getByTestId('lookup-panel-footer');
148+
expect(within(footer).getByTestId('show-all-results')).toBeInTheDocument();
149+
expect(within(popover).queryByTestId('lookup-create-new')).toBeNull();
150+
});
151+
152+
it('no matching option: the empty state keeps its centred create button and draws no footer', async () => {
153+
const { popover, listbox } = await openPicker(25, 60);
154+
const input = within(popover).getByRole('combobox');
155+
await act(async () => {
156+
fireEvent.change(input, { target: { value: 'nothing matches this' } });
157+
});
158+
await waitFor(() => expect(within(popover).getByText('No options found')).toBeInTheDocument());
159+
expect(within(listbox).getByRole('button', { name: /Create/ })).toBeInTheDocument();
160+
expect(within(popover).queryByTestId('lookup-panel-footer')).toBeNull();
161+
});
162+
163+
it('↑/↓ still reach the last option and aria-activedescendant names an option in the listbox', async () => {
164+
const { popover, listbox } = await openPicker(25, 60);
165+
const input = within(popover).getByRole('combobox');
166+
for (let i = 0; i < 30; i++) fireEvent.keyDown(input, { key: 'ArrowDown' });
167+
const active = input.getAttribute('aria-activedescendant');
168+
expect(active).toBeTruthy();
169+
const option = document.getElementById(active!);
170+
expect(listbox).toContainElement(option);
171+
expect(option).toHaveTextContent('Account 25');
172+
fireEvent.keyDown(input, { key: 'ArrowUp' });
173+
expect(document.getElementById(input.getAttribute('aria-activedescendant')!)).toHaveTextContent('Account 24');
174+
});
175+
176+
it('while open, the page behind the popover is hidden from assistive technology (the popover is modal)', async () => {
177+
const { container, popover } = await openPicker(3, 3);
178+
expect(container).toHaveAttribute('aria-hidden', 'true');
179+
expect(popover.closest('[aria-hidden="true"]')).toBeNull();
180+
});
181+
});

‎ui/packages/fields/src/widgets/LookupField.pickedLabel-10559.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ async function settle(): Promise<void> {
112112

113113
/** Each selected-value chip's label, read from its remove control's name. */
114114
function chipLabels(): string[] {
115+
// `hidden`: read while the (modal) dropdown is open, the field behind it is
116+
// hidden from assistive technology, and the chip with it.
115117
return screen
116-
.queryAllByRole('button', { name: /^Remove / })
118+
.queryAllByRole('button', { name: /^Remove /, hidden: true })
117119
.map((b) => (b.getAttribute('aria-label') ?? '').replace(/^Remove /, ''));
118120
}
119121

‎ui/packages/fields/src/widgets/LookupField.tsx‎

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,52 @@ export function LookupField({ value, onChange, field, readonly, error: fieldErro
20002000
) : null;
20012001

20022002
// The candidate panel: the popover's body, or the list cell's editor itself.
2003+
//
2004+
// In the popover the search row is pinned at the top, the options scroll in
2005+
// the middle, and "show all results" and quick-create sit in a footer pinned
2006+
// under the list (objectstack#36825). Inside the room Radix reports the list
2007+
// is what gives way, so they stay whole and clickable whatever its length,
2008+
// on either side the popover opens to. The footer reads the same `canCreate`
2009+
// as the empty state's create button, and is not drawn when it would hold
2010+
// nothing. The list cell's editor keeps both at the end of its list, above
2011+
// its own pinned rows.
2012+
const panelFace: 'popover' | 'cell' = inCell && !props.disabled ? 'cell' : 'popover';
2013+
const offersShowAll = hasDataSource && totalCount > filteredOptions.length;
2014+
const showAllButton = offersShowAll ? (
2015+
<button
2016+
type="button"
2017+
className={cn('w-full shrink-0 whitespace-nowrap text-center px-3 py-2 rounded-md text-sm font-medium text-primary hover:bg-accent flex items-center justify-center gap-1.5', PHONE_TOUCH_HEIGHT)}
2018+
onClick={() => {
2019+
setIsOpen(false);
2020+
setIsPickerOpen(true);
2021+
}}
2022+
data-testid="show-all-results"
2023+
>
2024+
<TableProperties className="size-3.5" />
2025+
{t('lookup.showAllResults', { count: totalCount })}
2026+
</button>
2027+
) : null;
2028+
const createButton = canCreate ? (
2029+
<button
2030+
type="button"
2031+
className={cn('w-full min-w-0 flex-1 text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground', PHONE_TOUCH_HEIGHT)}
2032+
disabled={creating}
2033+
onClick={() => handleCreateNew(searchQuery)}
2034+
data-testid="lookup-create-new"
2035+
>
2036+
{creating ? <Loader2 className="size-3.5 shrink-0 animate-spin" /> : <Plus className="size-3.5 shrink-0" />}
2037+
<span className="truncate">{searchQuery ? t('lookup.createNamed', { name: searchQuery }) : t('lookup.createNew')}</span>
2038+
</button>
2039+
) : null;
2040+
const listShowsOptions = !error && !(loading && filteredOptions.length === 0) && visibleOptions.length > 0;
2041+
// One row under the list: quick-create on the left (its typed name cut
2042+
// short when long), "show all" on the right.
2043+
const pinnedFooter = panelFace === 'popover' && listShowsOptions && (showAllButton || createButton) ? (
2044+
<div className="flex shrink-0 items-center gap-1 border-t p-1 [&>button]:w-auto" data-testid="lookup-panel-footer">
2045+
{createButton ?? <span className="flex-1" aria-hidden="true" />}
2046+
{showAllButton}
2047+
</div>
2048+
) : null;
20032049
const lookupPanelBody = (
20042050
<>
20052051
{/* Search input — not offered on a target whose search resolves to
@@ -2143,38 +2189,16 @@ export function LookupField({ value, onChange, field, readonly, error: fieldErro
21432189
);
21442190
})}
21452191
{/* Show total count when fetched from DataSource */}
2146-
{hasDataSource && totalCount > filteredOptions.length && (
2192+
{offersShowAll && (
21472193
<p className="text-xs text-muted-foreground text-center py-2">
21482194
{t('lookup.showingResults', { shown: filteredOptions.length, total: totalCount })}
21492195
</p>
21502196
)}
2151-
{/* "Show All Results" button — opens the full Record Picker (Level 2) */}
2152-
{hasDataSource && totalCount > filteredOptions.length && (
2153-
<button
2154-
type="button"
2155-
className={cn('w-full text-center px-3 py-2 rounded-md text-sm font-medium text-primary hover:bg-accent flex items-center justify-center gap-1.5', PHONE_TOUCH_HEIGHT)}
2156-
onClick={() => {
2157-
setIsOpen(false);
2158-
setIsPickerOpen(true);
2159-
}}
2160-
data-testid="show-all-results"
2161-
>
2162-
<TableProperties className="size-3.5" />
2163-
{t('lookup.showAllResults', { count: totalCount })}
2164-
</button>
2165-
)}
2166-
{/* Quick-create entry (below results) */}
2167-
{canCreate && (
2168-
<button
2169-
type="button"
2170-
className={cn('w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground', PHONE_TOUCH_HEIGHT)}
2171-
disabled={creating}
2172-
onClick={() => handleCreateNew(searchQuery)}
2173-
>
2174-
{creating ? <Loader2 className="size-3.5 animate-spin" /> : <Plus className="size-3.5" />}
2175-
{searchQuery ? t('lookup.createNamed', { name: searchQuery }) : t('lookup.createNew')}
2176-
</button>
2177-
)}
2197+
{/* The list cell's editor keeps "show all" (opens the full
2198+
Record Picker, Level 2) and quick-create at the end of its
2199+
list; the popover pins them below it. */}
2200+
{panelFace === 'cell' && showAllButton}
2201+
{panelFace === 'cell' && createButton}
21782202
</>
21792203
)}
21802204
</div>
@@ -2188,12 +2212,13 @@ export function LookupField({ value, onChange, field, readonly, error: fieldErro
21882212
{listMore.below && (
21892213
<div
21902214
aria-hidden="true"
2191-
className="pointer-events-none absolute inset-x-0 bottom-0 h-6 rounded-b-md bg-gradient-to-t from-popover to-transparent"
2215+
className={cn('pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-popover to-transparent', !pinnedFooter && 'rounded-b-md')}
21922216
data-testid="lookup-list-more-below"
21932217
/>
21942218
)}
21952219
</div>
21962220
)}
2221+
{pinnedFooter}
21972222
</>
21982223
);
21992224

@@ -2413,7 +2438,12 @@ export function LookupField({ value, onChange, field, readonly, error: fieldErro
24132438
</div>
24142439
) : (
24152440
<div className="flex items-center gap-1.5">
2441+
{/* `modal`: the popover is its own scroll-lock layer. Portalled out of
2442+
a modal form's DOM, a non-modal popover's list sits outside that
2443+
dialog's scroll lock, which cancels every wheel and touch move on
2444+
it; as the topmost lock its list scrolls (objectstack#36825). */}
24162445
<Popover
2446+
modal
24172447
open={isOpen}
24182448
onOpenChange={(o) => {
24192449
if (!dependenciesMissing) setIsOpen(o);

0 commit comments

Comments
 (0)