bug: emoji suggestions open for times like 12:00 and Enter inserts an emoji instead of sending

Đang mở Phù hợp với người mới
#1,431 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/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ệ
javascript, react
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu bằng cách đọc useSearchEmoji và kết quả khớp hiện tại /:([a-zA-Z0-9_+-]*?)$/; so sánh với hành vi triggerAnywhere trong ComposerPopupProvider hoặc useComposerBoxPopup. Hoàn tất khi dấu hai chấm trong giờ và tỷ lệ không mở gợi ý emoji, còn :smi vẫn hoạt động ở đầu câu, sau dấu cách và trên dòng mới.

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

Mô tả

Description:

The emoji suggestions open for any colon followed by two characters, including the colon inside a time or a ratio. While the list is open, Enter picks the highlighted emoji instead of sending the message, so a message like "meeting at 12:00" is changed to "meeting at 12💯 " and not sent.

useSearchEmoji matches /:([a-zA-Z0-9_+-]*?)$/, which does not check what comes before the colon. Rocket.Chat's own composer only opens the emoji popup when the colon starts the message or follows a space ((?:^|\s):, from triggerAnywhere in ComposerPopupProvider / useComposerBoxPopup).

Steps to reproduce:
  1. In the message box, type meeting at 12:00.
  2. The emoji list opens with 💯.
  3. Press Enter.
Expected behavior:

No emoji list opens for 12:00, and Enter sends "meeting at 12:00".

Actual behavior:

The list opens and Enter replaces :00 with 💯. The message box now contains "meeting at 12💯 " and nothing is sent. Other examples with the current emoji list: see you at 10:30 (🈯), ratio 16:10 (💯, 🔟), note:ok (10 suggestions).

I'd like to send a fix that requires the colon to be at the start of the message or after a space, as in Rocket.Chat. Typing :smi at the start, after a space, or on a new line keeps working.

Ngôn ngữ chính
JavaScript
Star
170
Fork
397
Merge trung bình
8 ngày 20 giờ
Pull request đã merge (30 ngày)
6

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 RocketChat/EmbeddedChat

Tất cả issue của RocketChat/EmbeddedChat

Issue tương tự

Thêm issue về JavaScript

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.