Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
58eaa2dd
Commit
58eaa2dd
authored
Oct 12, 2021
by
davidzagi93@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced document.getElementById with useRef
parent
9858d121
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
remix-ui-terminal.tsx
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+6
-6
No files found.
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
View file @
58eaa2dd
...
@@ -64,6 +64,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -64,6 +64,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
// terminal dragable
// terminal dragable
const
leftRef
=
useRef
(
null
)
const
leftRef
=
useRef
(
null
)
const
panelRef
=
useRef
(
null
)
const
scrollToBottom
=
()
=>
{
const
scrollToBottom
=
()
=>
{
messagesEndRef
.
current
.
scrollIntoView
({
behavior
:
'smooth'
})
messagesEndRef
.
current
.
scrollIntoView
({
behavior
:
'smooth'
})
...
@@ -297,15 +298,14 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -297,15 +298,14 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
})
})
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
const
leftRef
=
document
.
getElementById
(
'terminal-view'
)
if
(
panelRef
)
{
if
(
leftRef
)
{
if
(
!
leftHeight
)
{
if
(
!
leftHeight
)
{
setLeftHeight
(
leftRef
.
offsetHeight
)
setLeftHeight
(
panelRef
.
current
.
offsetHeight
)
return
return
}
}
leftRef
.
style
.
height
=
`
${
leftHeight
}
px`
panelRef
.
current
.
style
.
height
=
`
${
leftHeight
}
px`
}
}
},
[
leftHeight
,
setLeftHeight
,
inputEl
])
},
[
leftHeight
,
setLeftHeight
,
panelRef
])
/* block contents that gets rendered from scriptRunner */
/* block contents that gets rendered from scriptRunner */
...
@@ -438,7 +438,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
...
@@ -438,7 +438,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
}
}
return
(
return
(
<
div
style=
{
{
height
:
'323px'
,
flexGrow
:
1
}
}
className=
'panel'
>
<
div
style=
{
{
height
:
'323px'
,
flexGrow
:
1
}
}
className=
'panel'
ref=
{
panelRef
}
>
<
div
className=
"bar"
>
<
div
className=
"bar"
>
<
div
className=
"dragbarHorizontal"
onMouseDown=
{
mousedown
}
ref=
{
leftRef
}
></
div
>
<
div
className=
"dragbarHorizontal"
onMouseDown=
{
mousedown
}
ref=
{
leftRef
}
></
div
>
<
div
className=
"menu border-top border-dark bg-light"
data
-
id=
"terminalToggleMenu"
>
<
div
className=
"menu border-top border-dark bg-light"
data
-
id=
"terminalToggleMenu"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment