UiKit modal and contextual bar remount on every re-render, typed input is lost
I maintainer di solito rispondono entro 1 giorno
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
- javascript, react
- Ambito
- frontend
Direzione di ricerca
La chiave errata è su UiKitModal in packages/react/src/views/ChatBody/ChatBody.js (intorno alla riga 440) e su UiKitContextualBar in packages/react/src/views/ChatLayout/ChatLayout.js (intorno alla riga 173). Verifica che gli oggetti dati della vista contengano un id stabile, quindi sostituisci Math.random() con quell'id. Completato quando il testo digitato in un modale o in una barra contestuale sopravvive al nuovo rendering della stanza causato da un nuovo messaggio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description:
UiKitModal and UiKitContextualBar are rendered with a random key:
packages/react/src/views/ChatBody/ChatBody.js:440:<UiKitModal key={Math.random()} initialView={uiKitModalData} />packages/react/src/views/ChatLayout/ChatLayout.js:173:<UiKitContextualBar key={Math.random()} ... />
Because the key changes on every render, React unmounts and remounts the surface whenever the parent re-renders (a new message arrives, the typing indicator updates, scroll state changes). Anything the user typed into an app's modal or contextual bar is lost and the surface state is reset.
Steps to reproduce:
- Install a Rocket.Chat app that opens a UIKit modal (or contextual bar) with a text input.
- Open it from EmbeddedChat and start typing in the input.
- While it is open, have another user send a message in the room (anything that re-renders ChatBody / ChatLayout).
- The modal remounts and the typed text is gone.
Expected behavior:
The modal / contextual bar keeps its state until the view itself changes.
Actual behavior:
The surface is remounted on every parent re-render and loses its input.
Suggested fix: use a stable key, the view id (key={uiKitModalData?.id} and key={uiKitContextualBarData?.id}). I'd be happy to open a PR for this.
- Lingua principale
- JavaScript
- Stelle
- 171
- Fork
- 421
- Merge medio
- 3g 6h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 RocketChat/EmbeddedChat
-
Bug: username fallback in updateUserUsername never runs since the ddp-client migrationForse già presa @MuhammadFaizan-prog l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RocketChat/EmbeddedChat#1489 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Low contrast on color swatch borders in Theme Lab (Layout Editor)Forse già presa @yashsarvaiya45 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
RocketChat/EmbeddedChat#1486 ·
I maintainer di solito rispondono entro 1 giorno
-
bug(api): _doConnect swallows connection/auth errors and marks failed sessions as authenticatedForse già presa @ashwanisingh011 l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
RocketChat/EmbeddedChat#1484 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: White screen crash (`Cannot read properties of undefined (reading 'members')`) when rendering UserMention outside MarkupInteractionContextForse già presa @swarnendusahu10-dotcom l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/EmbeddedChat#1482 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: UIKit PreviewBlock cover image tiles repeatedly and stretches across viewport when zoomed outForse già presa @swarnendusahu10-dotcom l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
RocketChat/EmbeddedChat#1480 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RocketChat/EmbeddedChat
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
[Docs] CONTRIBUTING.md links to retired GitHub Learning Lab and Try Git sitesForse già presa @adityamukesh l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
reillywalter/win-dev-doctor#92 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] 新增「查看完整听歌设备记录」接口Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100