File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const QuickStartPanelContent: React.FC<QuickStartPanelContentProps> = ({
5656 ...props
5757} ) => {
5858 const titleRef = React . useRef ( null ) ;
59- const { getResource, activeQuickStartState } =
59+ const { getResource, activeQuickStartState, focusOnQuickStart } =
6060 React . useContext < QuickStartContextValues > ( QuickStartContext ) ;
6161 const [ contentRef , setContentRef ] = React . useState < HTMLDivElement > ( ) ;
6262 const shadows = useScrollShadows ( contentRef ) ;
@@ -90,10 +90,10 @@ const QuickStartPanelContent: React.FC<QuickStartPanelContentProps> = ({
9090 } ;
9191
9292 React . useEffect ( ( ) => {
93- if ( quickStart ) {
93+ if ( focusOnQuickStart && quickStart ) {
9494 titleRef . current . focus ( ) ;
9595 }
96- } , [ quickStart ] ) ;
96+ } , [ focusOnQuickStart , quickStart ] ) ;
9797
9898 const content = quickStart ? (
9999 < DrawerPanelContent
Original file line number Diff line number Diff line change @@ -66,12 +66,14 @@ const QuickStartTaskHeader: React.FC<QuickStartTaskHeaderProps> = ({
6666 children,
6767} ) => {
6868 const titleRef = React . useRef ( null ) ;
69+ const { focusOnQuickStart } = React . useContext ( QuickStartContext ) ;
70+
6971 React . useEffect ( ( ) => {
70- if ( isActiveTask ) {
72+ if ( focusOnQuickStart && isActiveTask ) {
7173 // Focus the WizardNavItem button element that contains the title
7274 titleRef . current . parentNode . focus ( ) ;
7375 }
74- } , [ isActiveTask ] ) ;
76+ } , [ focusOnQuickStart , isActiveTask ] ) ;
7577 const classNames = css ( 'pfext-quick-start-task-header__title' , {
7678 'pfext-quick-start-task-header__title-success' : taskStatus === QuickStartTaskStatus . SUCCESS ,
7779 'pfext-quick-start-task-header__title-failed' :
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export interface QuickStartContextValues {
7979 setLoading ?: any ;
8080 alwaysShowTaskReview ?: boolean ;
8181 setAlwaysShowTaskReview ?: any ;
82+ focusOnQuickStart ?: boolean ;
8283}
8384
8485export const QuickStartContextDefaults = {
@@ -104,6 +105,7 @@ export const QuickStartContextDefaults = {
104105 markdown : null ,
105106 loading : false ,
106107 alwaysShowTaskReview : true ,
108+ focusOnQuickStart : true ,
107109} ;
108110export const QuickStartContext = createContext < QuickStartContextValues > ( QuickStartContextDefaults ) ;
109111
You can’t perform that action at this time.
0 commit comments