diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx index fea605b13d067..b898f1b3fd7ab 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { memo, useCallback, useMemo } from 'react'; +import React, { FC, memo, useCallback, useEffect, useMemo, useRef } from 'react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButton, EuiButtonEmpty, + EuiButtonProps, + PropsForButton, EuiModal, EuiModalBody, EuiModalFooter, @@ -66,6 +68,21 @@ const getTranslations = (entry: Immutable | undefined) => ({ ), }); +const AutoFocusButton: FC> = memo((props) => { + const buttonRef = useRef(null); + const button = ; + + useEffect(() => { + if (buttonRef.current) { + buttonRef.current.focus(); + } + }, []); + + return button; +}); + +AutoFocusButton.displayName = 'AutoFocusButton'; + export const TrustedAppDeletionDialog = memo(() => { const dispatch = useDispatch>(); const isBusy = useTrustedAppsSelector(isDeletionInProgress); @@ -100,7 +117,7 @@ export const TrustedAppDeletionDialog = memo(() => { {translations.cancelButton} - { data-test-subj={CONFIRM_SUBJ} > {translations.confirmButton} - +