Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Specify when the selection collapsing happen on mouse click

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
api, frontend

Hướng nghiên cứu

Start with the Selection API issue and its linked CodePen demo, focusing on the click listener and window.getSelection().isCollapsed behavior described in the report. Compare the browser ordering cases in the issue and define the expected relationship between selection collapsing and the click event; done means the specification states a consistent, interoperable behavior.

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

Mô tả

Compatibility

Problem: The order between selection collapsing and click event is different across browsers

Demo: http://codepen.io/SaschaNaz/pen/wdeqZX

This small code listens click event, checks window.getSelection().isCollapsed, and opens a popup only when the selection is collapsed.

Howto:

click-selection

Browsers show different behavior here. In the click listener, Edge 15.16184 preview and Firefox 53 get collapsed selection, Edge 15.15063 and Chrome get non-collapsed selection (although Chrome suffers race condition and sometimes gets collapsed one).

I'm using selection check on click listener to allow users freely click anywhere to deselect text without worrying button click, but this inconsistency blocks my use case. (I expect every browser get non-collapsed selection on click listener.)

Ngôn ngữ chính
HTML
Star
49
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 w3c/selection-api

Tất cả issue của w3c/selection-api

Issue tương tự

Thêm issue về Backend & API Design

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.