mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
Handle window resize for terminal textarea
This commit is contained in:
parent
b2a6b4a9f0
commit
55a2466afe
1 changed files with 11 additions and 2 deletions
|
|
@ -100,7 +100,17 @@ const Terminal: React.FC<TerminalProps> = ({ output, handleSendStdin, shouldAllo
|
|||
const resizeObserver = new ResizeObserver(updateSize)
|
||||
resizeObserver.observe(textarea)
|
||||
|
||||
return () => resizeObserver.disconnect()
|
||||
// Add window resize event listener
|
||||
const handleWindowResize = () => {
|
||||
hiddenTextarea.style.width = `${textarea.clientWidth}px`
|
||||
updateSize()
|
||||
}
|
||||
window.addEventListener("resize", handleWindowResize)
|
||||
|
||||
return () => {
|
||||
resizeObserver.disconnect()
|
||||
window.removeEventListener("resize", handleWindowResize)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -318,7 +328,6 @@ const Terminal: React.FC<TerminalProps> = ({ output, handleSendStdin, shouldAllo
|
|||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
opacity: 0,
|
||||
...(textAreaStyle as any),
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue