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

Đang mở
#1,212 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
60/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
6
Fork
3
Merge trung bình
5 giờ 21 phút
Pull request đã merge (30 ngày)
378

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeatlasdev/ui

Tất cả issue của codeatlasdev/ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.