Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Table, Tree table: focus is lost after closing a column filter with Apply, Clear or Close

Chiusa
#896 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@fateeand ci sta già lavorando.

Dal 26/10/2026.

  • #898 di @fateeand — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug library

Problem

When a column filter menu is opened from its filter button in the header cell, closing it with a button inside the menu sends focus to <body>. Keyboard users then have to Tab from the top of the page to get back to the table, and screen readers lose their place. (WCAG 2.4.3 Focus Order.)

Pressing Esc already does the right thing: focus goes back to the filter button. Apply, Clear and Close (×) should do the same.

Steps to reproduce

  1. Tab to a column's filter button ("Open filter menu") and press Enter.
  2. Close the menu in one of these ways:
    • Apply (filterShowApplyButton is true), or
    • Clear, when filterHideOnClear is true, or
    • Close filter (×) in the menu header.
  3. Check document.activeElement.

Actual: <body>, with no focus ring anywhere.
Expected: the column's filter button, with its focus ring for keyboard users. This is what Esc does now.

Seen in cps-ui-kit 21.30.1. Both cps-table (cpsTColFilter) and cps-tree-table (cpsTTColFilter) render the same table-column-filter component, so both are affected.

Cause

applyFilter(), clearFilter() (with hideOnClear) and onCloseClick() all call hide() → columnFilterMenu.hide(). That path doesn't return focus to the trigger button. The focused button is inside the menu, so when the menu closes, focus is lost.

Proposal

When the menu is closed from inside (Apply, Clear with hideOnClear, Close), move focus back to the filter button (.cps-table-col-filter-menu-button) the same way Esc does. Use CPS_FOCUS_SERVICE.focusElement(button, isKeyboard()) so the ring shows only for keyboard users. Do this only when focus was inside the menu, so clicking outside the menu doesn't pull focus back.

Lingua principale
TypeScript
Stelle
9
Fork
7
Merge medio
1g 15h
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AbsaOSS/cps-shared-ui

Tutte le issue di AbsaOSS/cps-shared-ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.