mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-05 05:18:05 +08:00
🐛 fix(data-grid): 修复当前页查找高亮残留并压缩旧版结果工具栏
- 当前页查找改为即时响应,清空或按 Esc 后立即取消高亮 - 查找渲染版本元数据改为可透传,避免高亮状态残留 - 旧版结果工具栏调整为紧凑单行布局并移除重复分页信息 - JSON 和文本视图隐藏当前页查找入口
This commit is contained in:
@@ -114,4 +114,13 @@ describe('dataGridFind', () => {
|
||||
expect(hasDataGridFindRenderVersionChanged(betaRows[0], alphaRows[0])).toBe(true);
|
||||
expect(hasDataGridFindRenderVersionChanged(rows[0], alphaRows[0])).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps find render metadata on symbol keys while allowing wrapped rows to preserve it', () => {
|
||||
const rows = [{ id: 1, name: 'Alpha' }];
|
||||
const alphaRows = attachDataGridFindRenderVersion(rows, 'alpha');
|
||||
|
||||
expect(Object.keys(alphaRows[0])).toEqual(['id', 'name']);
|
||||
expect(Object.getOwnPropertySymbols(alphaRows[0]).length).toBeGreaterThan(0);
|
||||
expect(hasDataGridFindRenderVersionChanged(alphaRows[0], rows[0])).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ export const attachDataGridFindRenderVersion = <T>(rows: T[], query: string): T[
|
||||
const nextRow = { ...(row as object) } as T;
|
||||
Object.defineProperty(nextRow, DATA_GRID_FIND_RENDER_VERSION, {
|
||||
value: normalizedQuery,
|
||||
enumerable: false,
|
||||
enumerable: true,
|
||||
});
|
||||
return nextRow;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user