import * as React from "react"; import { useState, useMemo } from "@storybook/addons"; import { BuilderThemeWrapper } from "../../stories/story-utils.js"; import { type GridCell, GridCellKind, type Item } from "../../internal/data-grid/data-grid-types.js"; import { DataEditorAll as DataEditor } from "../../data-editor-all.js"; import { styled } from "@linaria/react"; export default { title: "Tests/TestCases/Bugs", decorators: [ (Story: React.ComponentType) => ( ), ], }; const bug70Gen = ([, row]: Item): GridCell => ({ allowOverlay: true, kind: GridCellKind.Number, data: row, displayData: row.toString(), }); const ignore = () => undefined; const Bug70Style = styled.div` display: flex; flex-direction: column; > a { margin-bottom: 20px; } `; export function Bug70() { const cols = [ { title: "Col1", width: 100 }, { title: "Col2", width: 100 }, ]; return (

To cause error: scroll down at least one row, edit a cell in Col2, and hit Tab

Original report
); } const filterColumnsGen = ([col, row]: Item): GridCell => ({ allowOverlay: true, kind: GridCellKind.Text, data: `${col} - ${row}`, displayData: `${col} - ${row}`, }); const filteringColumns = [ { title: "Col AAAA", width: 120 }, { title: "Col AAA", width: 120 }, { title: "Col AA", width: 120 }, { title: "Col A", width: 120 }, { title: "Col", width: 120 }, ]; export function FilterColumns() { const [searchText, setSearchText] = useState(""); const cols = useMemo(() => { if (searchText === "") { return filteringColumns; } return filteringColumns.filter(c => c.title.toLowerCase().includes(searchText.toLowerCase())); }, [searchText]); const onInputChange = (e: React.ChangeEvent) => { setSearchText(e.target.value); }; return (
); }