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

Aperta Adatta ai principianti
#1,431 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, react
Ambito
frontend

Direzione di ricerca

Inizia leggendo useSearchEmoji e la sua corrispondenza attuale /:([a-zA-Z0-9_+-]*?)$/; confrontala con il comportamento di triggerAnywhere in ComposerPopupProvider o useComposerBoxPopup. Il lavoro è completato quando i due punti negli orari e nei rapporti non aprono suggerimenti di emoji, mentre :smi continua a funzionare all’inizio, dopo uno spazio e su una nuova riga.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
170
Fork
397
Merge medio
8g 20h
PR unite (30g)
6

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/EmbeddedChat

Tutte le issue di RocketChat/EmbeddedChat

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.