Unverified Commit 04bbd5c8 authored by Manoj Pandian Sakthivel's avatar Manoj Pandian Sakthivel Committed by GitHub
Browse files

Scroll BlastForm to top when changing between views (#737)

parent bb1d2ec9
Pipeline #270647 passed with stages
in 5 minutes and 12 seconds
......@@ -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} />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment