Skip to content

Commit 3110de5

Browse files
fix(fields): line-item grid stores an emptied multi-record lookup cell as null, reads names once per object, mutes an empty list (#36616)
Fixes #36552 Clause-②: no Metadata-protocol: none ## 维护者速读 - 编辑带明细行表格的记录时(控制台里人员列、多选查找列),清空多选查找格现在存为空值而不是空列表;二十行的人员列从二十次读取变成一次;列表模式下空列表的破折号变灰。 - 属于明细行表格(多选、标签、人员单元格)那一批工作的收尾,替上次评审留下的四个非阻塞项收口。 - 若出错,碰到的是明细行表格里人员和查找列的名字显示或清空后的存值;改动只在表格组件内,可直接撤回这一个合并。 - 无。 Opened for `repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD` (area s2-A). ## What changes The editable line-item grid (`@object-ui/fields`, `GridFieldWidget`), the four items of #36552: 1. **An emptied multi-record lookup cell writes `null`.** The lookup cell's `onChange` now goes through `emptyListAsNull`, the helper the multi-select, tags and people cells already use. Measured on `origin/main` at `e7399fcdb` before the change: un-picking the last record of a `lookup` column with `multiple: true` wrote `[{"products":[]}]`. 2. **Names are read once per referenced object, not once per line.** Measured on `origin/main` at `e7399fcdb`: twenty lines with a `user` column and a `lookup` column (naming two products) made **20 `findOne` on `sys_user` and 20 on `product`**, 0 `find`. Each cell is its own `LookupField`, whose hydration reads its one bare id with `findOne`. The grid now hands every people and lookup cell it draws (editable cell, the people cell's resting face and panel, the read-only table, list mode) a data source from the new `grid-field/lineReferenceReads.ts`: the page's source, with the plain by-id read (`findOne(object, id)`, no options) gathered per tick into one `find(object, { $filter: { id: { $in: ids } } })` per object, ids de-duplicated, at most 50 ids per read (`LookupField`'s own `$in` page size). Every other member, and a by-id read carrying options, passes to the page's source unchanged (bound to it). Same grid after the change: **1 `$in` read of `sys_user` (20 ids), 1 of `product` (2 ids), 0 `findOne`**, in editable, read-only and list mode. **Why not `$expand` on the child read (Prime Directive 5, SQL first):** the grid does not make that read. Its rows arrive as a value: from `MasterDetailForm`'s and `LineItemsPanel`'s reads of the child object (both in `@object-ui/plugin-form`, outside this card's file surface), or stored inline as the `grid` field's JSON, where no `$expand` reaches the ids inside. An expanded reference in a row is also what the save diff and the blank-line check would read and send back. One `$in` read per object is one SQL `IN` query, at the one place every host's rows pass through. 3. **The multi-person cell's `null` on Clear is pinned** (it was right by reading). 4. **Display leftovers.** `cellDisplayText`'s `multiselect` arm loses its unreachable empty-list return (the guard at the top already answers an empty list with the em dash). In list mode the muted class reads `isEmptyCell`, so a stored `[]` draws the em dash muted, as `null` and `''` did. Changeset: `.changeset/36552-line-item-grid-followups.md`, patch for `@object-ui/fields`. ### Read first (by risk) 1. `ui/packages/fields/src/widgets/grid-field/lineReferenceReads.ts`: the `Proxy` around the page data source, and `flush` (chunking, de-duplication, rows keyed by `id` else `_id` as `LookupField`'s own `$in` read keys them, `null` for an id the read did not return, rejection fan-out). 2. `ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx`: the `cellSource` line and the `dataSource={cellSource}` props on the five cell sites; the lookup `onChange` hunk. 3. `ui/packages/fields/src/widgets/GridField.test.tsx`: the pins, one top-level describe at the end of the file (`line-item grid follow-ups: ... (objectstack#36552)`). ## Tests Seven pins in one top-level describe at the end of `GridField.test.tsx` (moved there from a separate file once #36607 landed, per ruling record 6583487846; names and assertions unchanged): multi-record lookup un-pick writes `null`; multi-person Clear writes `null`; one `$in` read per object and zero `findOne` with all 20 names drawn, in editable, read-only and list mode; a backend answering with `_id` only still draws each name from the one read; list-mode `[]` multi-select and tags cells draw the muted em dash. <details><summary>Package runs at head fbdfc7d (after merging origin/main at ed0edb1, which brought #36607)</summary> - `pnpm --filter @object-ui/fields type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`): clean. - `GridField.test.tsx` + `GridField.lookupAutofill-28245.test.tsx`: `Test Files 2 passed (2)`, `Tests 140 passed (140)`; the seven pins alone (`-t 36552`): `Tests 7 passed`. - Earlier, at 2431b1b, the whole package: `Test Files 323 passed | 1 skipped (324)`, `Tests 4897 passed | 7 skipped (4904)`. </details> <details><summary>Ablation (one leg per pinned behaviour, through scripts/ablation-replace.mjs, restored and proven)</summary> The subject is imported by relative path from source, so no `dist/` is involved. Each leg: anchor x1 to x0, blob changed, run, restore with blob == HEAD and `git diff HEAD` empty. - lookup `onChange` without `emptyListAsNull`: the multi-record lookup pin fails, 1 failed / 5 passed. - people `onWrite` without `emptyListAsNull`: the multi-person pin fails, 1 failed / 5 passed. - `cellSource` forced to `undefined` (cells read the page source directly): the three one-read pins fail, 3 failed / 3 passed. - list-mode muted test back to `null`/`''`: the muted pin fails, 1 failed / 5 passed. - (at fbdfc7d) rows keyed by `id` only: `× a backend that answers with _id only`, 1 failed / 6 passed. The first four legs ran while the pins were in their own file; the moved pins are byte-identical in name and assertion. </details> ## Acceptance notes - **Test placement.** The pins first lived in their own file because open PR #36607 edited `GridField.test.tsx`; #36607 has merged, so they now sit in `GridField.test.tsx` as one top-level describe (ruling record 6583487846), and the separate file is deleted. - **Reads that still go per cell.** A by-id read with options, a lookup column whose `idField` is not `id` (`LookupField` reads those with `find` on an equality filter, not `findOne`), and an id the batched read did not return (deleted or unreadable; the cell's own read gets the same answer). Out of the card's shape; noted, not changed. - **README / docs.** No sentence in `ui/packages/fields/README.md` or `content/docs/frontend/` describes the per-line read, the stored `[]` or the muted class, so none was made false; none edited. - **Seen while measuring, not changed:** a `lookup` column with `multiple: true` reads `undefined` in read-only and list mode (the two read-only `LookupField` sites pass no `multiple`), while the editable cell reads `2 selected`. Reported to the seat. ## Verification Two minutes: from `ui/`, run `pnpm --filter @object-ui/fields exec vitest run --root ../.. -t 36552 packages/fields/src/widgets/GridField.test.tsx`. Expect `Tests 7 passed`, the rest of the file skipped. Gates: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 38 families at 2b1bd44 and the same 38 at fbdfc7d; all 38 ran locally with exit 0 at each head (`--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, all with exit codes). Everything else is CI's. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmNmMEXS4EzeVz9RjvD)_ <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmNmMEXS4EzeVz9RjvD --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4ef1ea9 commit 3110de5

4 files changed

Lines changed: 351 additions & 8 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/fields': patch
3+
---
4+
5+
fix(fields): the line-item grid stores an emptied multi-record lookup cell as `null`, draws a people or lookup column's names with one read, and mutes an empty list in list mode
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **An emptied multi-record lookup cell writes `null`.** Un-picking the last record of a `lookup` column with `multiple: true` wrote an empty list (`[]`) into the line, while an emptied multi-select, tags or people cell writes `null`, the value the field contract stores for a cleared multi-value field. It now writes `null` too, so every emptied multi-value cell in the grid stores the same value and the save's blank-line check reads it as empty.
11+
- **Names are read once per referenced object, not once per line.** Each people cell and lookup cell holding a bare record id read that record on its own to draw its name, so a grid of twenty lines with a people column made twenty reads of `sys_user`, and a lookup column twenty more of its target. The grid now gathers those reads into one read per referenced object (an `$in` on the record ids, up to 50 ids per read), with each id asked for once, in editable, read-only and list mode alike. What each cell draws is unchanged.
12+
- **A stored empty list reads muted in list mode.** A multi-select or tags cell holding `[]` drew the em dash in the normal text colour; it now takes the muted colour, as an empty value already did.
13+
14+
No metadata key, value or default changes.

‎ui/packages/fields/src/widgets/GridField.test.tsx‎

Lines changed: 181 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { describe, it, expect, vi } from 'vitest';
2-
import { render, screen, fireEvent, waitFor, within } from '@testing-library/react';
2+
import { render, screen, fireEvent, waitFor, within, act } from '@testing-library/react';
33
import React from 'react';
44
import { UploadProvider } from './UploadProvider';
55
import { Dialog, DialogContent, DialogTitle } from '@object-ui/components';
66
import { formatDate, formatDateTime } from '@object-ui/core';
77
import { I18nProvider } from '@object-ui/i18n';
88
import { en, zh } from '@object-ui/i18n/locales';
9+
import { SchemaRendererContext } from '@object-ui/react';
910
import { GridFieldWidget as GridField } from './grid-field/GridFieldWidget';
1011
import { GridField as GridFieldFace, LineItemsField, sumColumn, lookupAutofillPatch, UNTOUCHED_NEW_ROW, isUntouchedNewRow, columnHelpByField } from './GridField';
1112

@@ -1640,3 +1641,182 @@ describe('GridField — the lazy face the package exports (objectstack#36102)',
16401641
});
16411642
});
16421643
});
1644+
1645+
/**
1646+
* objectstack#36552 — the line-item grid's follow-ups to objectstack#36043:
1647+
*
1648+
* - every emptied multi-value cell writes `null`: the multi-record lookup
1649+
* cell (it wrote `[]`) and the multi-person cell (right by reading, unpinned);
1650+
* - a people or lookup column draws its names with one read per referenced
1651+
* object, not one `findOne` per line;
1652+
* - in list mode a stored empty list reads as the muted em dash.
1653+
*/
1654+
describe('line-item grid follow-ups: null on an emptied multi-value cell, one name read per object, a muted empty list (objectstack#36552)', () => {
1655+
const PRODUCTS = [
1656+
{ id: 'p1', name: 'Widget' },
1657+
{ id: 'p2', name: 'Gadget' },
1658+
];
1659+
const USERS = Array.from({ length: 20 }, (_, i) => ({ id: `u${i + 1}`, name: `Person ${i + 1}` }));
1660+
1661+
function makeSource() {
1662+
const tables: Record<string, Record<string, unknown>[]> = { product: PRODUCTS, sys_user: USERS };
1663+
return {
1664+
find: vi.fn(async (object: string, params?: { $filter?: Record<string, any> }) => {
1665+
const rows = tables[object] ?? [];
1666+
const wanted = params?.$filter?.id?.$in as unknown[] | undefined;
1667+
const picked = wanted ? rows.filter((r) => wanted.includes(r.id)) : rows;
1668+
return { data: picked.map((r) => ({ ...r })), total: picked.length };
1669+
}),
1670+
findOne: vi.fn(async (object: string, id: string) => {
1671+
const row = (tables[object] ?? []).find((r) => r.id === id);
1672+
return row ? { ...row } : null;
1673+
}),
1674+
};
1675+
}
1676+
type Source = ReturnType<typeof makeSource>;
1677+
1678+
function Host({
1679+
ds,
1680+
initial,
1681+
columns,
1682+
onChange,
1683+
displayMode,
1684+
readonly,
1685+
}: {
1686+
ds?: Source;
1687+
initial: any[];
1688+
columns: any[];
1689+
onChange?: (v: any[]) => void;
1690+
displayMode?: 'list';
1691+
readonly?: boolean;
1692+
}) {
1693+
const [rows, setRows] = React.useState(initial);
1694+
const grid = (
1695+
<GridField
1696+
value={rows}
1697+
onChange={(v: any[]) => {
1698+
setRows(v);
1699+
onChange?.(v);
1700+
}}
1701+
field={{ columns } as never}
1702+
displayMode={displayMode}
1703+
readonly={readonly}
1704+
/>
1705+
);
1706+
return ds ? <SchemaRendererContext.Provider value={{ dataSource: ds } as never}>{grid}</SchemaRendererContext.Provider> : grid;
1707+
}
1708+
1709+
/** The reads of `object` that reached the page's data source. */
1710+
const readsOf = (ds: Source, object: string) => ({
1711+
findOne: ds.findOne.mock.calls.filter((c) => c[0] === object).length,
1712+
find: ds.find.mock.calls.filter((c) => c[0] === object),
1713+
});
1714+
1715+
describe('an emptied multi-value cell writes null (objectstack#36552)', () => {
1716+
it('a multi-record lookup cell: un-picking its last record writes null, not []', async () => {
1717+
const onChange = vi.fn();
1718+
render(
1719+
<Host
1720+
ds={makeSource()}
1721+
initial={[{ products: ['p1'] }]}
1722+
columns={[{ name: 'products', label: 'Products', type: 'lookup', reference: 'product', multiple: true }]}
1723+
onChange={onChange}
1724+
/>,
1725+
);
1726+
await act(async () => {
1727+
fireEvent.click(screen.getAllByTestId('lookup-trigger')[0]);
1728+
});
1729+
const option = await waitFor(() => {
1730+
const el = screen.getAllByRole('option').find((o) => (o.textContent ?? '').includes('Widget'));
1731+
if (!el) throw new Error('Widget not offered');
1732+
return el;
1733+
});
1734+
await act(async () => {
1735+
fireEvent.click(option);
1736+
});
1737+
expect(onChange).toHaveBeenCalled();
1738+
expect(onChange.mock.calls.at(-1)![0][0].products).toBeNull();
1739+
});
1740+
1741+
it("a multi-person cell: the picker's Clear writes null, not []", async () => {
1742+
const onChange = vi.fn();
1743+
render(
1744+
<Host
1745+
initial={[{ owners: ['u1', 'u2'] }]}
1746+
columns={[{ name: 'owners', label: 'Owners', type: 'user', multiple: true }]}
1747+
onChange={onChange}
1748+
/>,
1749+
);
1750+
fireEvent.click(screen.getByRole('button', { name: 'Owners' }));
1751+
const panel = await screen.findByTestId('line-items-user-panel');
1752+
fireEvent.click(within(panel).getByTestId('lookup-in-cell-clear'));
1753+
await waitFor(() => expect(screen.queryByTestId('line-items-user-panel')).toBeNull());
1754+
expect(onChange).toHaveBeenCalled();
1755+
expect(onChange.mock.calls.at(-1)![0][0].owners).toBeNull();
1756+
});
1757+
});
1758+
1759+
describe('a people or lookup column reads its names once, not once per line (objectstack#36552)', () => {
1760+
const columns = [
1761+
{ name: 'owner', label: 'Owner', type: 'user' },
1762+
{ name: 'product', label: 'Product', type: 'lookup', reference: 'product' },
1763+
];
1764+
// Twenty lines: twenty people, and two products named ten times each.
1765+
const lines = USERS.map((u, i) => ({ owner: u.id, product: PRODUCTS[i % 2].id }));
1766+
1767+
for (const mode of ['editable', 'read-only', 'list'] as const) {
1768+
it(`${mode}: one $in read of sys_user and one of the product, no read per line, every name drawn`, async () => {
1769+
const ds = makeSource();
1770+
render(
1771+
<Host ds={ds} initial={lines} columns={columns} readonly={mode === 'read-only'} displayMode={mode === 'list' ? 'list' : undefined} />,
1772+
);
1773+
for (const u of USERS) expect(await screen.findByText(u.name)).toBeTruthy();
1774+
await waitFor(() => expect(screen.getAllByText('Gadget')).toHaveLength(10));
1775+
expect(screen.getAllByText('Widget')).toHaveLength(10);
1776+
1777+
const people = readsOf(ds, 'sys_user');
1778+
expect(people.findOne).toBe(0);
1779+
expect(people.find).toHaveLength(1);
1780+
expect(people.find[0][1]).toMatchObject({ $filter: { id: { $in: USERS.map((u) => u.id) } } });
1781+
1782+
const products = readsOf(ds, 'product');
1783+
expect(products.findOne).toBe(0);
1784+
expect(products.find).toHaveLength(1);
1785+
expect(products.find[0][1]).toMatchObject({ $filter: { id: { $in: ['p1', 'p2'] } } });
1786+
});
1787+
}
1788+
1789+
it('a backend that answers with `_id` only: each line still draws its name from the one read', async () => {
1790+
const ds = makeSource();
1791+
ds.find.mockImplementation(async (object: string, params?: { $filter?: Record<string, any> }) => {
1792+
const wanted = (params?.$filter?.id?.$in ?? []) as unknown[];
1793+
const rows = object === 'product' ? PRODUCTS.filter((r) => wanted.includes(r.id)) : [];
1794+
return { data: rows.map(({ id, ...rest }) => ({ _id: id, ...rest })), total: rows.length };
1795+
});
1796+
render(<Host ds={ds} initial={lines.slice(0, 4).map(({ product }) => ({ product }))} columns={[columns[1]]} readonly />);
1797+
await waitFor(() => expect(screen.getAllByText('Widget')).toHaveLength(2));
1798+
expect(screen.getAllByText('Gadget')).toHaveLength(2);
1799+
expect(readsOf(ds, 'product').findOne).toBe(0);
1800+
expect(readsOf(ds, 'product').find).toHaveLength(1);
1801+
});
1802+
});
1803+
1804+
describe('list mode: a stored empty list reads as the muted em dash (objectstack#36552)', () => {
1805+
it('a multi-select and a tags cell holding [] draw — in the muted colour, as null does', () => {
1806+
render(
1807+
<Host
1808+
displayMode="list"
1809+
initial={[{ colors: [], labels: [], note: null }]}
1810+
columns={[
1811+
{ name: 'colors', label: 'Colors', type: 'multiselect', options: [{ label: 'Red', value: 'red' }] },
1812+
{ name: 'labels', label: 'Labels', type: 'tags' },
1813+
{ name: 'note', label: 'Note', type: 'text' },
1814+
]}
1815+
/>,
1816+
);
1817+
const dashes = screen.getAllByText('—');
1818+
expect(dashes).toHaveLength(3);
1819+
for (const dash of dashes) expect(dash.className).toContain('text-muted-foreground');
1820+
});
1821+
});
1822+
});

‎ui/packages/fields/src/widgets/grid-field/GridFieldWidget.tsx‎

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import { RatingField } from '../RatingField.js';
4242
import { useBooleanValueLabel } from '../booleanValueLabel.js';
4343
import { isImeKey } from '../imeKey.js';
4444
import { GRID_FIELD_RETIRED_KEYS, type GridFieldMetadata, type GridFieldRetiredKey } from '@object-ui/types';
45+
import { SchemaRendererContext } from '@object-ui/react';
46+
import { lineReferenceSource } from './lineReferenceReads.js';
4547
// The grid's pure half: the column type, the computed-cell evaluator, the
4648
// lookup-pick patch and the row marks. They live beside the public face in
4749
// `../GridField.ts`, in the eager chunk, because `@object-ui/fields` exports
@@ -138,7 +140,8 @@ const isEmptyCell = (value: unknown) =>
138140

139141
/** The star count of a `rating` column: its `max`, else `Field.rating`'s own 5 (objectstack#36043). */
140142
const ratingMax = (c: GridColumn) => c.max ?? 5;
141-
/** A list cell emptied by the user writes `null`, not `[]` (objectstack#36043):
143+
/** A list cell emptied by the user writes `null`, not `[]` (objectstack#36043;
144+
* the multi-record lookup cell too since objectstack#36552):
142145
* the field contract stores a cleared multi-value field as `null`, and the
143146
* save path's blank-line check (`isBlankRow`) reads only `null` / `''` as
144147
* empty, so a `[]` would send a line the user emptied as a child record. */
@@ -351,7 +354,6 @@ function cellDisplayText(c: GridColumn, value: any, locale: string, fileText: Ce
351354
}
352355
// A multi-select cell names each value by its option's label (objectstack#36043).
353356
if (c.type === 'multiselect' && Array.isArray(value)) {
354-
if (value.length === 0) return '—';
355357
return value.map((v) => c.options?.find((o) => String(o.value) === String(v))?.label ?? String(v)).join(', ');
356358
}
357359
// A check cell reads as its option's word (the session's, from the derive),
@@ -757,6 +759,14 @@ function GridFieldBody({
757759
};
758760
const displayText = (c: GridColumn, value: any, locale: string, cellCurrency?: string) =>
759761
cellDisplayText(c, value, locale, fileText, cellCurrency);
762+
// The data source every people and lookup cell reads its records through
763+
// (objectstack#36552): the page's, with the by-id read each cell makes to
764+
// draw a name gathered into one `$in` read per referenced object, so a grid
765+
// draws its names with one read per column instead of one per line.
766+
// `undefined` without a page data source: the cells then resolve their own,
767+
// as before. The same object on every render (`lineReferenceSource` keeps
768+
// one per page source), so no cell sees a new source it would re-read for.
769+
const cellSource = lineReferenceSource(React.useContext(SchemaRendererContext)?.dataSource);
760770
/**
761771
* The read-only face of a cell that is not text (objectstack#36043): people
762772
* by name, a rating as its stars; `null` for every other cell, which reads
@@ -765,7 +775,7 @@ function GridFieldBody({
765775
const readOnlyFace = (c: GridColumn, value: any): React.ReactNode | null => {
766776
if (isEmptyCell(value)) return null;
767777
if (c.type === 'user') {
768-
return <UserField value={value} onChange={() => {}} readonly field={{ type: 'user', multiple: c.multiple } as any} />;
778+
return <UserField value={value} onChange={() => {}} readonly field={{ type: 'user', multiple: c.multiple } as any} dataSource={cellSource} />;
769779
}
770780
if (c.type === 'rating') {
771781
return <RatingField value={Number(value)} onChange={() => {}} readonly field={{ type: 'rating', max: ratingMax(c) } as any} />;
@@ -1246,6 +1256,7 @@ function GridFieldBody({
12461256
onChange={() => {}}
12471257
readonly
12481258
field={{ reference: c.reference, displayField: c.displayField, idField: c.idField } as any}
1259+
dataSource={cellSource}
12491260
/>
12501261
) : (
12511262
// Every other cell reads through `displayText`, as the
@@ -1353,13 +1364,16 @@ function GridFieldBody({
13531364
if (c.type === 'lookup' && val != null && val !== '') {
13541365
return (
13551366
<LookupField value={val} onChange={() => {}} readonly
1356-
field={{ reference: c.reference, displayField: c.displayField, idField: c.idField } as any} />
1367+
field={{ reference: c.reference, displayField: c.displayField, idField: c.idField } as any}
1368+
dataSource={cellSource} />
13571369
);
13581370
}
13591371
const face = readOnlyFace(c, val);
13601372
if (face) return face;
13611373
return (
1362-
<span className={cn('px-2 text-sm text-foreground', isNumeric(c.type) && 'tabular-nums', (val == null || val === '') && 'text-muted-foreground')}>
1374+
// Muted exactly when the text is the em dash an empty cell reads as,
1375+
// a stored empty list included (objectstack#36552).
1376+
<span className={cn('px-2 text-sm text-foreground', isNumeric(c.type) && 'tabular-nums', isEmptyCell(val) && 'text-muted-foreground')}>
13631377
{displayText(c, val, displayLocale, currencyOf(c))}
13641378
</span>
13651379
);
@@ -1380,7 +1394,10 @@ function GridFieldBody({
13801394
return (
13811395
<LookupField
13821396
value={val}
1383-
onChange={(v: any) => setCellValue(rowIdx, c.name, v)}
1397+
// A multi-record lookup emptied by the user writes `null`, as the
1398+
// multi-select, tags and people cells do (objectstack#36552).
1399+
onChange={(v: any) => setCellValue(rowIdx, c.name, emptyListAsNull(v))}
1400+
dataSource={cellSource}
13841401
onSelectRecord={(rec: any, picked?: { sourceFields?: Readonly<Record<string, unknown>> | null }) => applyLookupSelection(rowIdx, c, rec, picked)}
13851402
compact
13861403
field={{ reference: c.reference, displayField: c.displayField, idField: c.idField, multiple: c.multiple, options: c.options, placeholder: '—' } as any}
@@ -1475,7 +1492,7 @@ function GridFieldBody({
14751492
panelTestId="line-items-user-panel"
14761493
>
14771494
{({ draft, setDraft, commit }) => (
1478-
<UserField inCell value={draft} onChange={(next: any) => setDraft(next)} onCommit={commit} field={field} />
1495+
<UserField inCell value={draft} onChange={(next: any) => setDraft(next)} onCommit={commit} field={field} dataSource={cellSource} />
14791496
)}
14801497
</GridPanelCell>
14811498
);

0 commit comments

Comments
 (0)