SearchField: busca com limpar, Esc, role=search e estado vazio

Offen
#1,212 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
60/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Start in the component source beside the existing TextField and Combobox, since SearchField should reuse their prop and accessibility conventions; the apps/web/... paths point at a private repo and are reference only. Add the component with value, debounce, onsearch, a localized aria-label on the clear button, Esc clearing, a role="search" container and an aria-live counter, then export it from the package entry point. Done when tests cover the four acceptance criteria: one call after 250ms, Esc emitting onsearch(""), a labelled 44px clear button on coarse pointers, and the "Nenhum resultado" announcement.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:a11y area:forms enhancement

Versão: @codeatlasdev/ui 4.6.0 · código lido em main (950628f2) · classe: lacuna (migração do AC)

Problema

O AC depende deste comportamento hoje e a lib não o oferece. Sem ele, a migração perde qualidade no desktop, no mobile ou no PWA.

O que a lib já oferece (para não duplicar) e o que falta

TextField type="search" não tem limpar nem Esc. Combobox filtra mas não é campo de busca livre. useDebouncedValue do AC não tem equivalente documentado na lib.

Referência no AC

Caminhos do repo AC (repo privado, só caminho):

apps/web/src/components/geography/map/overlays/search-box.tsx:13-30 (debounce 250, URL, sem clear, sem Esc); apps/web/src/components/whatsapp/numbers-tab.tsx:166-168 (type=search); apps/web/src/components/admin/cliche-client-picker.tsx (debounce, mínimo de 2, XIcon).

Defeitos do AC (verificados por leitura do código): (leitura) search-box.tsx: sem botão limpar, sem Esc e sem landmark de busca. (leitura) numbers-tab.tsx: type=search sem nome visível (só placeholder).

Proposta

SearchField com value, debounce, onsearch, botão limpar (aria-label localizado), Esc limpa, role="search" no contêiner e contagem de resultados via aria-live="polite".

Critério de aceite (testável)

  • Digitar e esperar 250ms chama onsearch uma vez.
  • Esc com texto limpa e chama onsearch("").
  • Botão limpar tem nome acessível e alvo de 44px em coarse.
  • Sem resultados, o contador anuncia "Nenhum resultado".

Mãe: #1089

Vorherrschende Sprache
TypeScript
Sterne
6
Forks
3
Ø Merge
5 Std. 21 Min.
Gemergte PRs (30 T.)
378

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codeatlasdev/ui

Alle Issues in codeatlasdev/ui

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.