Skip to content

Commit

Permalink
1404 fix focus element (#32387)
Browse files Browse the repository at this point in the history
* create new branch for Kaemon to try updating logic for PR

* Change focusElement to scrollTo

Signed-off-by: KaemonIsland <kaemonlovendahl@outlook.com>

* Kaemon's edits for #1404

* Remove temp change

Signed-off-by: KaemonIsland <kaemonlovendahl@outlook.com>

---------

Signed-off-by: KaemonIsland <kaemonlovendahl@outlook.com>
Co-authored-by: KaemonIsland <kaemonlovendahl@outlook.com>
Co-authored-by: Edwin Otero <30818791+ediiotero@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 86d4fe9 commit 67f6f61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/applications/ask-va/components/ProgressBar.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { focusElement } from 'platform/utilities/ui';
import scrollTo from 'platform/utilities/ui/scrollTo';
import { CHAPTER_1, CHAPTER_2, CHAPTER_3 } from '../constants';
import {
aboutMyselfRelationshipVeteranPages,
Expand Down Expand Up @@ -67,7 +67,8 @@ const ProgressBar = ({ pathname }) => {

useEffect(
() => {
focusElement('.ava-progress-bar > h2');
// Scroll back to the top of the form
scrollTo('topScrollElement');
setViewedPages([...viewedPages, currentPath]);

if (!viewedPages.includes(currentPath) && percent < 100) {
Expand Down

0 comments on commit 67f6f61

Please sign in to comment.