cpsTooltip: can't be dismissed with Escape or hovered over (WCAG 1.4.13)

Đã đóng
#916 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

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

@fateeand đang làm issue này rồi.

Từ ngày 3/11/2026.

  • #931 của @fateeand — đã merge

Đá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
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
angular, typescript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

Start in projects/cps-ui-kit/src/lib/directives/cps-tooltip/cps-tooltip.directive.ts: the host bindings around lines 38-48, onMouseLeave(), and _positionAndShow(), where popup listeners are added only for persistent tooltips. Add an Escape handler for hover, focus and trigger cases, and mouseenter/mouseleave handling on the popup so a pending hide is cancelled. Done when the Playwright spec in playwright/cps-ui-kit/directives/cps-tooltip.spec.ts covers Escape dismissal and hovering over the tooltip, and persistent, click and focus behaviour is unchanged.

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

Mô tả

accessibility bug library

Problem

cpsTooltip doesn't meet WCAG 1.4.13 (Content on Hover or Focus) with its default settings (tooltipOpenOn="hover", tooltipPersistent=false):

  • Not dismissible: pressing Escape doesn't close an open tooltip. Users have to move the pointer or focus away from the trigger to hide content that may cover other parts of the page.
  • Not hoverable: moving the pointer from the trigger onto the tooltip closes it after tooltipCloseDelay (300 ms). Users can't keep the tooltip open while reading it or while zooming in on it.

Found in AUL on the Dashboard: truncated domain-card titles show the full name in a cpsTooltip. On hover or keyboard focus, Escape leaves the tooltip open, and moving the pointer onto the tooltip makes it disappear.

Where

  • projects/cps-ui-kit/src/lib/directives/cps-tooltip/cps-tooltip.directive.ts:38-48: the host bindings have no Escape key handler.
  • cps-tooltip.directive.ts onMouseLeave(): always schedules _destroyTooltip for non-persistent tooltips.
  • cps-tooltip.directive.ts _positionAndShow(): popup listeners (focusout, keydown) are only added for persistent tooltips. None of them are mouseenter/mouseleave listeners, so hovering over the popup can't cancel the pending hide.

Acceptance criteria

  • Pressing Escape while the trigger or the tooltip has focus, or while the tooltip is shown on hover, closes the tooltip. Focus stays where it was, and nothing else on the page handles that Escape press.
  • Moving the pointer from the trigger onto a visible tooltip keeps it open. It closes after tooltipCloseDelay once the pointer leaves both the trigger and the tooltip.
  • The current behaviour for persistent, click-opened and focus-opened tooltips stays the same, apart from the new Escape dismissal.
  • Playwright tests in playwright/cps-ui-kit/directives/cps-tooltip.spec.ts cover Escape dismissal and hovering over the tooltip.
Ngôn ngữ chính
TypeScript
Star
9
Fork
8
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
23

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 AbsaOSS/cps-shared-ui

Tất cả issue của AbsaOSS/cps-shared-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.