Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl-client
Commits
04bbd5c8
Unverified
Commit
04bbd5c8
authored
Apr 27, 2022
by
Manoj Pandian Sakthivel
Committed by
GitHub
Apr 27, 2022
Browse files
Scroll BlastForm to top when changing between views (#737)
parent
bb1d2ec9
Pipeline
#270647
passed with stages
in 5 minutes and 12 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/content/app/tools/blast/views/blast-form/BlastForm.tsx
src/content/app/tools/blast/views/blast-form/BlastForm.tsx
+8
-2
No files found.
src/content/app/tools/blast/views/blast-form/BlastForm.tsx
View file @
04bbd5c8
...
...
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import
React
from
'
react
'
;
import
React
,
{
useEffect
,
useRef
}
from
'
react
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
useBlastConfigQuery
}
from
'
src/content/app/tools/blast/state/blast-api/blastApiSlice
'
;
...
...
@@ -81,10 +81,16 @@ const MainLarge = () => {
const
MainSmall
=
()
=>
{
const
step
=
useSelector
(
getStep
);
const
containerRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
containerClasses
=
`
${
styles
.
mainContainer
}
${
styles
.
mainContainerSmall
}
`
;
useEffect
(()
=>
{
containerRef
.
current
?.
scrollTo
({
top
:
0
,
behavior
:
'
smooth
'
});
},
[
step
]);
return
(
<
div
className
=
{
containerClasses
}
>
<
div
className
=
{
containerClasses
}
ref
=
{
containerRef
}
>
{
step
===
'
sequences
'
?
(
<>
<
BlastInputSequencesHeader
compact
=
{
true
}
/>
...
...
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