Context
I found this while reviewing #19788, the grid fix for #19787, whose ticket scopes Table behavior out. I reproduced it live on dev 5829f5d407 in examples/tableFiltering.
The Problem
In the table filtering example, a click into the Firstname header filter's empty input focuses it and also sorts the column ascending. The rows reorder from Tobias, Rich, Nils, Gerard to Bastian, Durlabh, Gerard, Hyle, and the header gains neo-sort-asc. No text was entered. A user who only wants to place the caret reorders the table.
The Architectural Reality
src/table/header/Button.mjs:191 pushes the filter field into the header button's own vdom, so clicks on the field reach the header's onClick (:378).
- That
onClick has no exclusion at all; it always advances the sort state. The grid header's onClick already skips the menu trigger and the resize handle (src/grid/header/Button.mjs:406–410), and #19788 adds the filter field to that list.
- Design authority:
learn/guides/datahandling/Grids.md defines header filters as "allowing users to filter data directly from the column headers", and its Sorting section makes a header click the sorting gesture (quoted in #19787). The grid header inherited this field from the table (#6169). Tables.md and the table header's JSDoc say nothing about either (searched).
The Fix
Mirror #19788 in src/table/header/Button.mjs onClick: return early when the click path contains the filter field's root (filterField.id). The input and its nested controls then never sort, while caption clicks still do. Add a Table arm to test/playwright/e2e/grid/HeaderInlineProjectionNL.spec.mjs, which already carries Table cases.
Acceptance Criteria
Out of Scope
The grid header (#19788), the header-filter layout (OQ8 in #19786), and the record-search toolbar.
Related
#19787 · #19788 · #19786
Live latest-open sweep: the latest 20 open issues at 09:43Z, re-checked at 09:44Z; no equivalent (only #19787, which is grid-scoped). A2A claim sweep: the last 30 lane-claims, none on the table header. MC sweep: "table header filter field click sorts the column", 4 results, no prior decision. Own-assignment sweep: 4 open, none on this surface.
Sequencing: start after #19788 merges, because both touch the same spec file.
Origin Session ID: bb2e8968-a6d6-4ef7-a4ed-5ab3157b1ac8
Retrieval Hint: "table header filter click sorts column onClick guard"
Context
I found this while reviewing
#19788, the grid fix for#19787, whose ticket scopes Table behavior out. I reproduced it live ondev5829f5d407inexamples/tableFiltering.The Problem
In the table filtering example, a click into the Firstname header filter's empty input focuses it and also sorts the column ascending. The rows reorder from Tobias, Rich, Nils, Gerard to Bastian, Durlabh, Gerard, Hyle, and the header gains
neo-sort-asc. No text was entered. A user who only wants to place the caret reorders the table.The Architectural Reality
src/table/header/Button.mjs:191pushes the filter field into the header button's own vdom, so clicks on the field reach the header'sonClick(:378).onClickhas no exclusion at all; it always advances the sort state. The grid header'sonClickalready skips the menu trigger and the resize handle (src/grid/header/Button.mjs:406–410), and#19788adds the filter field to that list.learn/guides/datahandling/Grids.mddefines header filters as "allowing users to filter data directly from the column headers", and its Sorting section makes a header click the sorting gesture (quoted in#19787). The grid header inherited this field from the table (#6169).Tables.mdand the table header's JSDoc say nothing about either (searched).The Fix
Mirror
#19788insrc/table/header/Button.mjsonClick: return early when the click path contains the filter field's root (filterField.id). The input and its nested controls then never sort, while caption clicks still do. Add a Table arm totest/playwright/e2e/grid/HeaderInlineProjectionNL.spec.mjs, which already carries Table cases.Acceptance Criteria
Out of Scope
The grid header (
#19788), the header-filter layout (OQ8 in#19786), and the record-search toolbar.Related
#19787 · #19788 · #19786
Live latest-open sweep: the latest 20 open issues at 09:43Z, re-checked at 09:44Z; no equivalent (only
#19787, which is grid-scoped). A2A claim sweep: the last 30 lane-claims, none on the table header. MC sweep: "table header filter field click sorts the column", 4 results, no prior decision. Own-assignment sweep: 4 open, none on this surface.Sequencing: start after
#19788merges, because both touch the same spec file.Origin Session ID: bb2e8968-a6d6-4ef7-a4ed-5ab3157b1ac8 Retrieval Hint: "table header filter click sorts column onClick guard"