pull/5370/head
yann300 3 years ago
parent 1d70aef400
commit 2d8ff4baf7
  1. 6
      libs/remix-ui/terminal/src/lib/custom-hooks/useDragTerminal.tsx
  2. 5
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

@ -26,7 +26,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => {
} }
const handleDraggingEnd = () => { const handleDraggingEnd = () => {
if(!isDragging) return if (!isDragging) return
setIsDragging(false) setIsDragging(false)
@ -38,7 +38,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
if(isOpen) { if (isOpen) {
setLastTerminalPosition(terminalPosition) setLastTerminalPosition(terminalPosition)
setLastYPosition(0) setLastYPosition(0)
setTerminalPosition(minHeight) setTerminalPosition(minHeight)
@ -62,7 +62,7 @@ export const useDragTerminal = (minHeight: number, defaultPosition: number) => {
// Reset terminal position // Reset terminal position
useEffect(() => { useEffect(() => {
if(!terminalPosition){ if (!terminalPosition) {
setTerminalPosition(defaultPosition) setTerminalPosition(defaultPosition)
} }
}, [terminalPosition, setTerminalPosition]) }, [terminalPosition, setTerminalPosition])

@ -95,7 +95,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
useEffect(() => { useEffect(() => {
event.trigger('resize', [terminalPosition]) event.trigger('resize', [terminalPosition])
} , [terminalPosition]) }, [terminalPosition])
const scrollToBottom = () => { const scrollToBottom = () => {
messagesEndRef.current.scrollIntoView({ behavior: 'smooth' }) messagesEndRef.current.scrollIntoView({ behavior: 'smooth' })
@ -211,9 +211,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
} }
} }
const focusinput = () => { const focusinput = () => {
inputEl.current.focus() inputEl.current.focus()
} }

Loading…
Cancel
Save