mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix(webview-ui): preserve edit content after virtualization and pre-scroll bubble into view before entering edit mode
This commit is contained in:
parent
03ac80fb17
commit
15932f901d
1 changed files with 9 additions and 0 deletions
|
|
@ -185,6 +185,15 @@ export const ChatRowContent = ({
|
|||
// No need to notify the backend
|
||||
}, [message.ts, message.text, message.images, mode, onStartEditing])
|
||||
|
||||
// Ensure edit fields are initialized when entering edit mode (including after virtualization re-mounts)
|
||||
useEffect(() => {
|
||||
if (!isEditing) return
|
||||
// Only initialize if user hasn't typed yet / images not selected
|
||||
setEditedContent((prev) => (prev !== "" ? prev : message.text || ""))
|
||||
setEditImages((prev) => (prev.length > 0 ? prev : message.images || []))
|
||||
setEditMode((prev) => prev || mode || "code")
|
||||
}, [isEditing, message.text, message.images, mode])
|
||||
|
||||
// Ensure the edit textarea is focused and scrolled into view when entering edit mode.
|
||||
// Uses a short delay and a few animation frames to allow virtualization reflow before scrolling.
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue