From 74aa2eef769b7ea03dc12a61ea0e5f47e8b53000 Mon Sep 17 00:00:00 2001 From: Ly Tempel Date: Wed, 30 Sep 2026 20:03:36 +0300 Subject: [PATCH 1/3] feat(text-field): isClearable defaults to true #945 --- .../components/content/table/table.spec.tsx | 12 ++++++++++++ .../form/textarea/textarea.spec.tsx | 5 +++++ .../components/form/textarea/textarea.tsx | 1 + .../form/textfield/textfield.spec.tsx | 19 +++++++++++++++++++ .../components/form/textfield/textfield.tsx | 10 ++++++---- 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/tedi/components/content/table/table.spec.tsx b/src/tedi/components/content/table/table.spec.tsx index 209cd6f1f..557f66ab0 100644 --- a/src/tedi/components/content/table/table.spec.tsx +++ b/src/tedi/components/content/table/table.spec.tsx @@ -853,6 +853,18 @@ describe('Table', () => { expect(screen.queryByRole('cell', { name: 'Jüri' })).not.toBeInTheDocument(); }); + it('resets the column filter from the clear button', () => { + render( id="t-filter-clear" data={data} columns={columns} enableColumnFilters />); + + fireEvent.change(screen.getByLabelText('Filter Name'), { target: { value: 'Anna' } }); + expect(screen.queryByRole('cell', { name: 'Jüri' })).not.toBeInTheDocument(); + + fireEvent.click(screen.getByTitle(/clear/i)); + + expect(screen.getByLabelText('Filter Name')).toHaveValue(''); + expect(screen.getByRole('cell', { name: 'Jüri' })).toBeInTheDocument(); + }); + it('forwards meta.filterProps (e.g. maxLength) to the built-in column filter input', () => { const filterColumns: ColumnDef[] = [ { id: 'name', header: 'Name', accessorKey: 'name', meta: { filterProps: { input: { maxLength: 40 } } } }, diff --git a/src/tedi/components/form/textarea/textarea.spec.tsx b/src/tedi/components/form/textarea/textarea.spec.tsx index 791515c63..70d792105 100644 --- a/src/tedi/components/form/textarea/textarea.spec.tsx +++ b/src/tedi/components/form/textarea/textarea.spec.tsx @@ -33,6 +33,11 @@ describe('Textarea component', () => { expect(textarea).toHaveAttribute('name', 'testTextarea'); }); + it('shows no clear button, even with a value', () => { + render(