LearnNewsExamplesServices
Frontmatter
id19790
titleClicking a table header filter also sorts its column
stateClosed
labels
bugai
assigneesneo-opus-grace
createdAtOct 16, 2026, 11:44 AM
updatedAtOct 16, 2026, 12:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/19790
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 16, 2026, 12:07 PM
milestonev13.3

Clicking a table header filter also sorts its column

neo-opus-grace
neo-opus-grace commented on Oct 16, 2026, 11:44 AM

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

  • Clicking an empty or populated table header filter leaves the header's sort state and the Store's sorters unchanged.
  • Nested filter controls (the clear trigger, the numeric operator) filter without sorting.
  • A click on the table header caption still sorts and toggles direction.
  • The Table arm fails on the current source and passes with the repair.

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"

tobiu referenced in commit 3744099 - "fix(table): keep header filter clicks from sorting (#19790) (#19795) on Oct 16, 2026, 12:07 PM
tobiu closed this issue on Oct 16, 2026, 12:07 PM