Skip to content

Commit

Permalink
[uptime] Fix tab focus issue for settings page (#87466)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
shahzad31 and kibanamachine committed Jan 7, 2021
1 parent eb0e6ba commit 4d207ff
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useEffect, useMemo, useState } from 'react';
import React, { useMemo, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { useDispatch } from 'react-redux';
import { EuiButtonEmpty } from '@elastic/eui';
Expand All @@ -31,16 +31,15 @@ export const AddConnectorFlyout = ({ focusInput }: Props) => {

const dispatch = useDispatch();

useEffect(() => {
dispatch(getConnectorsAction.get());
focusInput();
}, [addFlyoutVisible, dispatch, focusInput]);

const ConnectorAddFlyout = useMemo(
() =>
getAddConnectorFlyout({
consumer: 'uptime',
onClose: () => setAddFlyoutVisibility(false),
onClose: () => {
dispatch(getConnectorsAction.get());
setAddFlyoutVisibility(false);
focusInput();
},
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
Expand Down

0 comments on commit 4d207ff

Please sign in to comment.