Skip to content

[Bug] PowerSearch: a filter token's button leaves its value out of its name and does not expose the editor it opens #8946

Closed

Description

@duytbp

Description

In the default (popover) presentation, each filter token is a Token with onClick, so its action is the token's inner <button>. Two things are missing from that button:

  1. The value is not in its name. PowerSearch passes "{field}: {operator}" as the token label and renders the value as endContent (PowerSearch.tsx:898-902). Token names its inner button from the label alone and puts endContent outside the button (Token.tsx:458-470, Token AR2). So a token that shows "Status: is Open" is a button named "Status: is", and its remove button is "Remove Status: is". Two filters on one field with different values (or one filter whose value changed) sound the same. The visible text is not in the name either (WCAG 2.5.3 Label in Name).
  2. Nothing says it opens an editor. Pressing the token opens the filter editor popover and moves focus into it (PowerSearchEditPopover.tsx:638), but the button has no aria-expanded (or aria-haspopup), so it reads as a plain button that acts on press. Token gives a caller no way to set either: its inner button takes only onClick.

Expected: the token's action is named by everything the token shows (field, operator and value), and it exposes aria-expanded while its editor is open, as the sheet presentation's trigger already does (PowerSearch FR11). That likely needs Token to accept a name or ARIA props for its inner button, or PowerSearch to put the full text in the label.

Reproduction

import {useState} from 'react';
import {PowerSearch, type PowerSearchConfig, type PowerSearchFilter} from '@astryxdesign/core';

const config: PowerSearchConfig = {
  name: 'Issues',
  fields: [
    {
      key: 'status',
      label: 'Status',
      defaultOperator: 'is',
      operators: [
        {
          key: 'is',
          label: 'is',
          value: {type: 'enum', values: [{value: 'open', label: 'Open'}, {value: 'closed', label: 'Closed'}]},
        },
      ],
    },
  ],
};

export function Repro() {
  const [filters, setFilters] = useState<PowerSearchFilter[]>([
    {field: 'status', operator: 'is', value: {type: 'enum', value: 'open'}},
  ]);
  return <PowerSearch config={config} filters={filters} onChange={f => setFilters([...f])} />;
}
  1. Inspect the accessibility tree: the token shows "Status: is Open", but its button is named "Status: is", and the remove button "Remove Status: is".
  2. Focus the token and press Enter. The editor opens and focus moves into it; the token's button has no aria-expanded before or after.

Astryx Version

@astryxdesign/[email protected], still present on main (14fc587)

Environment

Chromium 156, accessibility tree read through the DevTools protocol. Not specific to one screen reader.

Activity

  1. added
    bug
    component
    on Nov 2, 2026
  2. added a commit that references this issue on Nov 3, 2026
    e68774f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityarea:corebugcomponent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions