SuperChat Mention List Stays Open After the Composer Loses Focus
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
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Inizia da src/components/Messaging/useMentionAutocomplete.tsx e dai gestori della textarea di ChatComposer; segui come l’hook apre e chiude il menu delle menzioni renderizzato in un portal. Trova i test del composer e copri la chiusura dell’elenco alla perdita del focus, la sua riapertura quando il focus torna su una @query incompleta e l’inserimento della menzione tramite selezione con il mouse. Il lavoro è completato quando questi casi passano e l’apertura del visualizzatore multimediale non lascia visibile alcun elenco di menzioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Overview
The @mention suggestion list in ChatComposer, which SuperChat and SuperChatInbox use, stays open after focus leaves the composer. Because the menu is portaled to document.body, it stays on screen over whatever comes next: a media viewer opened from the thread, or a different page in a host app that keeps the inbox mounted while it is hidden. The only way to dismiss it is to go back to the composer and press Escape or delete the @.
Steps to Reproduce
In Storybook: SuperChat › Inbox › Playground
- Type
@in the composer. The participant list opens. - Without choosing anyone, click an image in the thread to open the media viewer.
- The mention list stays open on top of the viewer.
In a host app that keeps the inbox mounted: TimeHuddle wraps its inbox page in React <Activity mode="hidden"> when another tab is showing.
- Type
@in the composer. - Switch to another tab or page.
- The mention list is still on screen over the other page.
Current State
useMentionAutocomplete(src/components/Messaging/useMentionAutocomplete.tsx) closes the menu only on Escape, when an option is inserted, or when an edit removes the@query.- Nothing closes it on textarea blur or on a pointer down outside the menu.
MentionMenurenders throughcreatePortal(..., document.body). Hiding or covering the composer's subtree does not hide the menu. React<Activity mode="hidden">, for example, does not hide portaled content.
Proposed Changes
- Close the menu when the textarea blurs
- Clear the active mention in the composer textarea's
onBlur, for example through aclose()that the hook returns. - Options already use
onMouseDownwithpreventDefault(), so clicking an option keeps focus and still inserts it. - The textarea's
onFocusoronSelectcan callsync()again, so returning to an unfinished@queryreopens the list.
- Clear the active mention in the composer textarea's
- Test
- Type
@, blur the textarea, and expectchat-composer-mention-listto be gone. - Refocus with the caret after the
@, and expect the list to reopen. - Clicking an option still inserts it.
- Type
Acceptance Criteria
- The mention list closes when the composer textarea loses focus.
- Choosing an option with the mouse still inserts the mention.
- Focusing the composer again with an unfinished
@queryreopens the list. - In Storybook, opening the media viewer while the list is open leaves no list on screen.
- A unit test covers closing on blur and reopening on focus.
Out of Scope (for Now)
- Shared listbox keyboard navigation (#376).
- Closing other portaled composer menus (the
+add menu, send options), which already close on outside click throughDropdown. - Changing how a host hides the inbox.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 7
- Merge medio
- 1g 12h
- PR unite (30g)
- 62
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mieweb/ui
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
src/tailwind-preset.cjs drifted from tailwind-preset.ts — missing `info` and `chart` color scalesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
SuperChatInbox: show the chat pane when the host opens or starts a conversation on small screensForse già presa @martincarapia l’ha presa oggi. Apertaenhancement
mieweb/ui#849 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
-
Mobile compliance: Safari Storybook testing and a Capacitor reference appForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Add: Alfa DramasApertacheck:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Maduki-tech/bautackt#4 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno