Skip to content

Commit a6607c7

Browse files
feat(grid): the cell editor and a cut-off value draw on a layer over the cell (#35688 S1) (#35990)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuFtZePhJzziPWQwzHnzpoZ1)_ repo:objectstack#1 · os-sales · session_01L6bhgVyFBp1oC6H2XfBmrm Part of #35688 (slice S1 of three; S2 pickers and dates, S3 lookups, numbers and wrap-up follow in their own pull requests, so the card stays open) Clause-②: no — `CellOverlay` and its geometry helpers live in two new modules that the `@object-ui/components` entry does not re-export, and the per-type width table stays private to `ObjectGrid`; no prop, type or i18n key is added or removed (the claim expected `yes`; measured `no` against the package entries) Metadata-protocol: none ## 维护者速读 - 列表里按回车(或双击)编辑任何格子,编辑框不再塞进格子把整行撑高,而是浮在格子上方:左上角对齐格子,至少和列一样宽,需要时更宽更高;行高和其他列都不动(实测 20 种可编辑类型全部 32 → 32,现状最高撑到 204)。 - 选中一个被截断的格子(长文本、多行、多选、标签、地址),原地浮出全文;再按回车或双击就在同一位置变成编辑框,Esc、点别处或方向键收起。布尔格按回车直接切换,不再弹出一个复选框。 - 最后一行、最右一列、冻结列里的格子、窄屏(768 宽)都完整可见:靠底自动向上翻,靠右自动左移;格子一半藏在冻结列下时先把它滚出来;编辑中把格子滚出表格可见区,就像点别处一样提交并收起。 - 下拉、日期、关联等控件本身还是现在的样子,只是换到了浮层里;它们的"格内"样式在 S2、S3 里改。 ## What changes **The editor draws on a layer over its cell** (`@object-ui/components`, `data-table`). New `CellOverlay` (`dataTableCellOverlay.tsx`): a Radix Popover with no portal, anchored on the cell (`side="bottom" align="start"`, offset by minus the cell's height, so its top-left corner sits on the cell's own corner). - The layer is `position: fixed`, so neither the row's height nor any column's width changes while a cell is edited. - It stays inside the cell's DOM subtree. Every `contains` read the grid already makes (click-outside, focus, keydown routing) still sees the editor inside its cell, so commit and cancel keep their current rules: Enter, Tab, a click elsewhere commit; Esc cancels. - It is at least the column's width (`--radix-popper-anchor-width`), grows to fit up to `min(32rem, available width)`, and its height is capped at the space available and scrolls inside. Near the viewport's bottom it flips so its bottom edge sits on the cell's bottom edge; near the right edge it shifts left (`avoidCollisions`, padding 8). - The host cell is raised (`z-30`, plus `relative` when not frozen) while its layer is open, because a fixed descendant still paints inside the cell's stacking context; without it a frozen column or the sticky header would cover the layer. - On open the cell is scrolled clear of the left-frozen columns, the right-pinned columns and the sticky header (`revealCell` in `dataTableCellOverlayDom.ts`). Once a scroll hides the cell behind them or out of the table's box, the editor commits and closes, as a click elsewhere would. - Radix keeps the layer hidden until it is placed, and a hidden control refuses focus, so the editor takes the caret on the first frame the layer is placed (retried for up to 30 frames). - Tab inside the layer never reaches Radix's focus loop, so it stays the grid's commit-and-move key. - All outside, Escape and auto-focus handlers of the popover are no-ops: the grid owns them. - An injected editor (`renderCellEditor`, which `ObjectGrid` passes) goes on the same layer. **At the row's density.** Inside the layer, single-line inputs and comboboxes are 32px tall with 13px text, and a textarea starts at least as tall as the preview it replaces. The built-in editor gets a starting width per type (`min-w-56` for dates, `min-w-40` otherwise); `ObjectGrid` wraps `FieldEditWidget` in a per-type width (address/location 22rem, long text 20rem, lookup/user 18rem, multi-select/tags 16rem, date/phone/url/email/currency 14rem, others 10rem). **A cut-off cell shows its whole value.** When the selection lands on a cell whose content is truncated (the check reads the cell's descendants, because cell renderers truncate on an inner span), the full content draws on the same kind of layer, wrapping, up to 16rem tall. - Enter, F2 or a double-click opens the editor in its place, at least as large as the preview was (the preview's size is passed as `--cell-overlay-min-w` / `--cell-overlay-min-h`). - Esc closes the preview and keeps the cell selected; an arrow key moves the selection, and the preview follows only if the next cell is cut off too. - After Esc in an editor opened from a preview, the preview does not come back; it shows again only when the selection moves onto a cut-off cell. **Enter on a two-state cell flips it** (boolean, toggle) instead of opening an editor holding one checkbox; Space and a second click already did. ## Tests - New `ui/packages/components/src/__tests__/data-table-cell-overlay-35688.test.tsx` (7 cases): the editor is in a fixed layer inside its cell and the cell is raised; an injected editor goes on the same layer; a cut-off cell shows a preview and one that fits does not; Enter on the preview opens the editor at least the preview's size and Esc does not bring the preview back; Esc on the preview keeps the selection and an arrow key moves on; Enter flips a two-state cell; scrolling the editing cell out of the table's box commits it. - No existing test was changed or deleted. The prototype failed one existing case (6859 C, Tab out of an injected editor) because of the popover's focus loop; the Tab guard above fixes the cause and the case passes unchanged. - Local runs: `@object-ui/components` 4771 passed / 24 skipped; `@object-ui/plugin-grid` 2591 passed; `@object-ui/plugin-list` 1970 passed. Typecheck (src and tests) clean for both changed packages; `data-table.tsx` lint warnings equal `main`'s (78), the new files have none. ## Acceptance notes (behaviour changes a reviewer should know) - The seeded size travels as two CSS custom properties in the layer's `style`, read by static Tailwind utilities. `ui/AGENTS.md` asks for no inline layout styles; this is a value the utilities read, not layout written inline, and the reviewer may prefer another carrier. - jsdom has no layout: the tests pin structure and gestures; the geometry (row height, flip, painting above frozen columns) is the browser reading below. - The editors themselves (select, date, lookup, percent's slider, rating) are drawn as they are today, only on the layer; their in-cell variants are S2 and S3. - Grids without select-first (no `GridCellSelectionProvider`) also draw their editor on the layer; the preview is drawn only where a cell can be selected. ## Review round 1 (head `055c8874`, after `170a2856`) From the L1 record (REWORK, comment 7057804492): - should-fix: the built-in editor's per-type `min-w-40` / `min-w-56`, merged last on the layer's class, replaced the layer's `min-w-[max(anchor width, seeded width)]` (same tailwind-merge group), so a grid without an injected editor could draw its editor narrower than the cell and lose the preview's seeded width → the floor now rides an inner box inside the layer, as `ObjectGrid`'s wrapper already did. Test 3 now pins the merged class and the inner box. - should-fix: the preview's `max-h-64` replaced the layer's `max-h-(--radix-popper-available-height)`, so in a short viewport the preview could run past the edge → one class, `max-h-[min(16rem,var(--radix-popper-available-height))]`. Test 2 pins it. - Both new assertions fail on `170a2856` (2 of 7 cases) and pass here. `@object-ui/components` 4771 passed / 24 skipped, `@object-ui/plugin-grid` 2591 passed, typecheck clean, `data-table.tsx` warnings unchanged (78). - Not changed: the CSS-custom-property carrier (L1 read it as acceptable); the preview covering neighbouring cells and `drawCell()` running the renderer twice are observations for the later slices. ## Verification Browser, showcase field zoo (`showcase_field_zoo`), a temporary 22-column view with the name column frozen (not part of this pull request), Chromium 1600×900 and 768×320, `main` d6be99d against this branch. | Reading | `main` | this branch | |---|---|---| | Row height when editing starts, 20 editable types | 41–204 (Name 49, Textarea 107, Percent 65, Multi-select 111, Tags 79, Rating 69, Address 204) | 32 → 32 for every type; other columns do not move | | Caret in the editor after Enter | — | 20 / 20 | | Layer's four corners on top (`elementFromPoint`), frozen-column cell included | — | all pass | | Last row at 768×320, address | — | the layer flips up, bottom edge on the cell's bottom edge, fully visible | | Rightmost columns (color, address) | — | shift left, stay on screen | | Cell half under the frozen column, Enter | — | scrolled clear first (layer's left edge 27 → 216) | | Editing cell scrolled out of the box | — | committed and closed; the value survives a reload | | Selected long text | truncated | full text wraps on a 512×72 layer; Enter opens a 512-wide editor there | | Boolean, Enter | an editor holding one checkbox | flips in place, no layer | Read first: `ui/packages/components/src/renderers/complex/dataTableCellOverlay.tsx` (the layer), `dataTableCellOverlayDom.ts` (reveal and hidden geometry), and the editor and preview blocks in `data-table.tsx`. Two-minute check: open any object list, select a long text cell (the full text floats over it), press Enter (the editor opens in the same place, the row does not grow), press Esc; then scroll to the last row and press Enter on an address cell (the form opens upward). --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVyFBp1oC6H2XfBmrm <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgVyFBp1oC6H2XfBmrm --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f548bdc commit a6607c7

7 files changed

Lines changed: 592 additions & 8 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/components': patch
3+
'@object-ui/plugin-grid': patch
4+
---
5+
6+
feat(grid): the inline cell editor floats over its cell, so the row keeps its height; a selected cell that is cut off shows its whole value
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
In `data-table` (and so in every grid `ObjectGrid` draws):
12+
13+
- **The editor draws on a layer over the cell** instead of inside it. The layer's top-left corner sits on the cell's, it is at least as wide as the column and grows wider or taller where the editor needs it (an address form, a record picker, a multi-line text), and neither the row's height nor any column's width changes. Near the bottom of the window it opens upward, near the right edge it shifts left, and its height is capped at the space left, scrolling inside. A cell partly hidden behind a frozen column, a right-pinned column or the sticky header is scrolled clear first; scrolling the cell out of sight commits the edit, as a click outside does. The layer stays inside the cell's DOM, so click-outside, Escape, Enter / Tab and focus behave as before. Tab inside the layer goes where it went before: the select-first grid commits and moves, other grids let the browser move focus.
14+
- **`ObjectGrid` sizes the layer per field type**: an address or location starts 22rem wide, a multi-line text, markdown, code or JSON 20rem, a lookup, master-detail or user 18rem, a multi-select, tags or checkboxes 16rem, a date, date-time, phone, URL, email or currency 14rem, anything else 10rem; never narrower than its cell.
15+
- **On the select-first grid** (the list page), a selected cell whose value the column cuts off shows it in full on a layer over the cell, wrapped and scrolling past a few lines. Escape, an arrow key or a click elsewhere closes it; Enter or a double-click turns it into the editor in the same place and at least the same size. Enter on a checkbox cell flips it, as Space and a second click already did, instead of opening an editor.

‎content/docs/frontend/plugins/plugin-grid.mdx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ through the host's data source (`dataSource.update`) with no callback to wire.
367367
editor. There is no `editable` key on `ListColumn`.
368368
- **Visual feedback**: editable cells show a hover state, and the input is
369369
focused and selected when editing begins
370+
- **The editor floats over its cell** (objectstack#35688): it opens on a layer
371+
anchored to the cell's top-left corner, at least as wide as the column and
372+
wider where its field type needs it (an address form, a record picker), so
373+
the row keeps its height and no other column moves. Near the bottom of the
374+
window the layer opens upward, near the right edge it shifts left, and a
375+
cell half hidden behind a frozen column or the header is scrolled into view
376+
first. Scrolling the cell out of sight commits the edit.
370377

371378
To own persistence in a React host, supply `onCellChange` as a **component
372379
prop** — it is not a schema key.
@@ -383,6 +390,11 @@ object and the view does not declare `userActions.editInline: false`, and
383390
- **A click selects** a cell (a ring around it); it neither edits nor opens the
384391
record. A link a cell draws (the name, a lookup, a phone or an email) keeps
385392
its own click. On a touch screen a tap opens the record.
393+
- **A cut-off value shows in full** when its cell is selected: a long text, a
394+
multi-line text or a list of tags that the column truncates opens on a
395+
layer over the cell, wrapped, scrolling inside past a few lines. Escape, an
396+
arrow key or a click elsewhere closes it; Enter or a double-click turns it
397+
into the editor in the same place and at the same size.
386398
- **Editing** starts on a double-click, Enter or F2 (the value kept, caret at
387399
its end), or by typing, which replaces the value; an input method's
388400
composition is kept whole. Backspace or Delete opens an empty editor and
@@ -393,7 +405,7 @@ object and the view does not declare `userActions.editInline: false`, and
393405
elsewhere commits.
394406
- **Selected cell keys:** the arrows and Tab move the selection; Space is typed
395407
like any other key and opens the editor (a checkbox cell flips instead, as
396-
does a second click on it); Ctrl/Cmd+C copies; Ctrl/Cmd+V converts the text
408+
do Enter and a second click on it); Ctrl/Cmd+C copies; Ctrl/Cmd+V converts the text
397409
to the field's type and commits it; Escape clears the selection. The record
398410
opens from the name link, or a tap on a touch screen.
399411
- **A cell that opens no editor says why** on the cell: the field is read-only,
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
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+
* `data-table`'s cell layer (objectstack#35688): the editor, and the full
11+
* content of a cut-off selected cell, draw on a layer over the cell instead of
12+
* inside it, so the row keeps its height. Layout itself (row height 32, the
13+
* flip at the viewport's edge, painting above frozen columns) is a browser
14+
* reading on the PR; jsdom has no layout, so these pin the structure and the
15+
* gestures.
16+
*
17+
* 1. The editor sits in a fixed-position layer inside its cell, the cell is
18+
* raised above the sticky cells, and nothing is drawn in the cell's flow.
19+
* An injected (host) editor goes on the same layer.
20+
* 2. A selected cell whose content is cut off shows it in full on a layer;
21+
* one that fits shows none.
22+
* 3. Enter on that preview opens the editor in its place, at least the
23+
* preview's size; Esc there does not bring the preview back.
24+
* 4. Esc on the preview closes it and keeps the cell selected; an arrow key
25+
* moves the selection and the preview with it.
26+
* 5. Enter on a two-state cell flips it and opens no layer.
27+
* 6. Scrolling the open editor's cell out of the table's box commits it.
28+
*/
29+
import React from 'react';
30+
import { describe, it, expect, afterEach, beforeEach, vi } from 'vitest';
31+
import { render, fireEvent, cleanup, act } from '@testing-library/react';
32+
import '@testing-library/jest-dom';
33+
import { ComponentRegistry } from '@object-ui/core';
34+
// Registers `data-table` at module scope, not in a hook (objectui#3010).
35+
import '../renderers';
36+
// `react-page` reaches a dynamic `import('@object-ui/react-runtime')`: pay its load
37+
// at collection, never inside a case's clocked window (`check:test-source-alias`).
38+
import '@object-ui/react-runtime';
39+
import { GridCellSelectionProvider } from '../context/gridCellSelection';
40+
41+
const LONG = 'A long note that runs well past the width of its column';
42+
43+
const ROWS = [
44+
{ id: '1', name: 'Alpha', note: LONG, done: false },
45+
{ id: '2', name: 'Beta', note: 'Short', done: true },
46+
];
47+
48+
// jsdom draws nothing: a text longer than ten characters reads as cut off.
49+
const proto = HTMLElement.prototype;
50+
const saved = {
51+
scrollWidth: Object.getOwnPropertyDescriptor(proto, 'scrollWidth'),
52+
clientWidth: Object.getOwnPropertyDescriptor(proto, 'clientWidth'),
53+
};
54+
beforeEach(() => {
55+
Object.defineProperty(proto, 'scrollWidth', { configurable: true, get() { return (this.textContent ?? '').length * 10; } });
56+
Object.defineProperty(proto, 'clientWidth', { configurable: true, get() { return 100; } });
57+
});
58+
afterEach(() => {
59+
cleanup();
60+
for (const [k, d] of Object.entries(saved)) {
61+
if (d) Object.defineProperty(proto, k, d);
62+
else delete (proto as unknown as Record<string, unknown>)[k];
63+
}
64+
});
65+
66+
function renderTable(extra: Record<string, unknown> = {}) {
67+
const DataTable = ComponentRegistry.get('data-table')!;
68+
const onCellChange = vi.fn();
69+
const schema = {
70+
type: 'data-table',
71+
columns: [
72+
{ header: 'Name', accessorKey: 'name' },
73+
{ header: 'Note', accessorKey: 'note' },
74+
{ header: 'Done', accessorKey: 'done', type: 'boolean' },
75+
],
76+
data: ROWS,
77+
editable: true,
78+
singleClickEdit: true,
79+
searchable: false,
80+
pagination: false,
81+
onCellChange,
82+
...extra,
83+
};
84+
const utils = render(
85+
<GridCellSelectionProvider value={{}}>
86+
<DataTable schema={schema} />
87+
</GridCellSelectionProvider>,
88+
);
89+
const cell = (row: number, col: number) =>
90+
utils.container.querySelectorAll('tbody tr')[row].querySelectorAll('td[data-grid-cell]')[col] as HTMLElement;
91+
const catcher = () => utils.container.querySelector<HTMLInputElement>('[data-slot="cell-type-catcher"]')!;
92+
const editorLayer = () => utils.container.querySelector<HTMLElement>('[data-slot="cell-editor-overlay"]');
93+
const previewLayer = () => utils.container.querySelector<HTMLElement>('[data-slot="cell-preview-overlay"]');
94+
return { ...utils, cell, catcher, editorLayer, previewLayer, onCellChange };
95+
}
96+
97+
describe('data-table — the editor and a cut-off cell draw on a layer over the cell (objectstack#35688)', () => {
98+
it('1. the editor sits in a fixed-position layer inside its cell, and the cell is raised', () => {
99+
const t = renderTable();
100+
fireEvent.click(t.cell(0, 0));
101+
fireEvent.keyDown(t.catcher(), { key: 'Enter' });
102+
const layer = t.editorLayer();
103+
expect(layer).not.toBeNull();
104+
// Inside the cell's DOM, so the grid's own `contains` reads hold.
105+
expect(t.cell(0, 0).contains(layer)).toBe(true);
106+
expect(layer!.querySelector('input')).toHaveValue('Alpha');
107+
// Out of the cell's flow: Radix places the layer's wrapper `fixed`.
108+
expect(layer!.closest<HTMLElement>('[data-radix-popper-content-wrapper]')!.style.position).toBe('fixed');
109+
expect(t.cell(0, 0).className).toMatch(/\bz-30\b/);
110+
expect(t.cell(1, 0).className).not.toMatch(/\bz-30\b/);
111+
});
112+
113+
it('1b. a host-injected editor goes on the same layer', () => {
114+
const t = renderTable({
115+
renderCellEditor: ({ value, stage }: { value: unknown; stage: (v: unknown) => void }) => (
116+
<input data-testid="host-editor" defaultValue={String(value)} onChange={(e) => stage(e.target.value)} />
117+
),
118+
});
119+
fireEvent.click(t.cell(0, 0));
120+
fireEvent.keyDown(t.catcher(), { key: 'Enter' });
121+
expect(t.editorLayer()!.querySelector('[data-testid="host-editor"]')).not.toBeNull();
122+
});
123+
124+
it('2. a selected cell that is cut off shows its whole content on a layer; one that fits shows none', () => {
125+
const t = renderTable();
126+
fireEvent.click(t.cell(0, 1));
127+
expect(t.previewLayer()).toHaveTextContent(LONG);
128+
expect(t.cell(0, 1).contains(t.previewLayer())).toBe(true);
129+
// Its height cap keeps the space-available cap (one class, not two that merge away).
130+
expect(t.previewLayer()!.className).toContain('max-h-[min(16rem,var(--radix-popper-available-height))]');
131+
expect(t.previewLayer()!.className).not.toMatch(/(^|\s)max-h-64(\s|$)/);
132+
fireEvent.click(t.cell(0, 0));
133+
expect(t.previewLayer()).toBeNull();
134+
});
135+
136+
it('3. Enter on the preview opens the editor in its place, at least its size; Esc does not bring it back', () => {
137+
const t = renderTable();
138+
fireEvent.click(t.cell(0, 1));
139+
const preview = t.previewLayer()!;
140+
vi.spyOn(preview, 'getBoundingClientRect').mockReturnValue({ width: 300, height: 72, top: 0, left: 0, right: 300, bottom: 72, x: 0, y: 0, toJSON: () => ({}) } as DOMRect);
141+
fireEvent.keyDown(t.catcher(), { key: 'Enter' });
142+
expect(t.previewLayer()).toBeNull();
143+
const layer = t.editorLayer()!;
144+
expect(layer.querySelector('input')).toHaveValue(LONG);
145+
expect(layer.style.getPropertyValue('--cell-overlay-min-w')).toBe('300px');
146+
expect(layer.style.getPropertyValue('--cell-overlay-min-h')).toBe('72px');
147+
// The utility that reads the seed survives the per-type floor, which rides an inner box.
148+
expect(layer.className).toContain('min-w-[max(var(--radix-popper-anchor-width),var(--cell-overlay-min-w,0px))]');
149+
expect(layer.className).not.toMatch(/(^|\s)min-w-40(\s|$)/);
150+
expect(layer.querySelector('.min-w-40')).not.toBeNull();
151+
fireEvent.keyDown(layer.querySelector('input')!, { key: 'Escape' });
152+
expect(t.editorLayer()).toBeNull();
153+
expect(t.previewLayer()).toBeNull();
154+
expect(t.cell(0, 1)).toHaveAttribute('data-selected-cell');
155+
});
156+
157+
it('4. Esc closes the preview and keeps the selection; an arrow key moves on', () => {
158+
const t = renderTable();
159+
fireEvent.click(t.cell(0, 1));
160+
fireEvent.keyDown(t.catcher(), { key: 'Escape' });
161+
expect(t.previewLayer()).toBeNull();
162+
expect(t.cell(0, 1)).toHaveAttribute('data-selected-cell');
163+
fireEvent.click(t.cell(1, 1));
164+
expect(t.previewLayer()).toBeNull();
165+
fireEvent.keyDown(t.catcher(), { key: 'ArrowUp' });
166+
expect(t.cell(0, 1)).toHaveAttribute('data-selected-cell');
167+
expect(t.previewLayer()).toHaveTextContent(LONG);
168+
});
169+
170+
it('5. Enter on a two-state cell flips it and opens no layer', () => {
171+
const t = renderTable();
172+
fireEvent.click(t.cell(0, 2));
173+
fireEvent.keyDown(t.catcher(), { key: 'Enter' });
174+
expect(t.editorLayer()).toBeNull();
175+
expect(t.onCellChange).toHaveBeenCalledWith(0, 'done', true, expect.anything());
176+
});
177+
178+
it('6. scrolling the open editor\'s cell out of the table\'s box commits it', () => {
179+
const t = renderTable();
180+
fireEvent.click(t.cell(0, 0));
181+
fireEvent.keyDown(t.catcher(), { key: 'Enter' });
182+
fireEvent.change(t.editorLayer()!.querySelector('input')!, { target: { value: 'Alpha 2' } });
183+
// The table's scroll box, and a cell scrolled past its left edge.
184+
const box = t.cell(0, 0).closest('table')!.parentElement!;
185+
box.style.overflowX = 'auto';
186+
vi.spyOn(box, 'getBoundingClientRect').mockReturnValue({ left: 0, top: 0, right: 100, bottom: 100, width: 100, height: 100, x: 0, y: 0, toJSON: () => ({}) } as DOMRect);
187+
Object.defineProperty(box, 'clientHeight', { configurable: true, value: 100 });
188+
vi.spyOn(t.cell(0, 0), 'getBoundingClientRect').mockReturnValue({ left: -200, top: 40, right: -50, bottom: 72, width: 150, height: 32, x: -200, y: 40, toJSON: () => ({}) } as DOMRect);
189+
act(() => { box.dispatchEvent(new Event('scroll')); });
190+
expect(t.editorLayer()).toBeNull();
191+
expect(t.onCellChange).toHaveBeenCalledWith(0, 'name', 'Alpha 2', expect.anything());
192+
});
193+
});

0 commit comments

Comments
 (0)