Skip to content

Commit 5615ccf

Browse files
authored
fix(protocol-designer): scroll to bottom of SelectBasics in onboarding (#19168)
Ensure scroll to bottom of scrollable basics selection container on any form change (useful for small or highly zoomed in screens) Accidentally targeted `edge` in #19165 Closes RQA-4507
1 parent b416044 commit 5615ccf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

protocol-designer/src/pages/Onboarding/SelectBasics.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ export function SelectBasics(props: WizardTileProps): JSX.Element {
107107

108108
useEffect(() => {
109109
handleScrollToBottom()
110-
}, [hasGripper, hasThermocycer, hasWasteChute, selectedPipetteName])
110+
}, [
111+
hasGripper,
112+
hasThermocycer,
113+
hasWasteChute,
114+
selectedPipetteName,
115+
robotType,
116+
])
111117

112118
const handleSwapMounts = (): void => {
113119
const leftPipetteName = pipettesByMount.left.pipetteName
@@ -393,11 +399,7 @@ export function SelectBasics(props: WizardTileProps): JSX.Element {
393399
</>
394400
) : null}
395401
{robotType === FLEX_ROBOT_TYPE && !noPipette && (
396-
<Flex
397-
flexDirection={DIRECTION_COLUMN}
398-
gridGap={SPACING.spacing60}
399-
ref={ref}
400-
>
402+
<Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing60}>
401403
<BasicsButtons
402404
type="gripper"
403405
subHeader={t('some_modules_require_gripper')}
@@ -434,6 +436,8 @@ export function SelectBasics(props: WizardTileProps): JSX.Element {
434436
) : null}
435437
</Flex>
436438
)}
439+
{/* empty div for scrolling to bottom on form changes */}
440+
<div ref={ref} />
437441
</WizardBody>
438442
</HandleEnter>
439443
</>

0 commit comments

Comments
 (0)