Skip to content

Commit

Permalink
fix: [Stateful: Indices: Overview page] Missing focus on New button a…
Browse files Browse the repository at this point in the history
…fter closing or cancelling Generate API key dialog (#196905)

Closes: #196174

## Description 

Focus should be visible on any accessible element and in order when
navigating through the elements. Especially for the users using
assistive technology, only keyboard.
For the dialogs, after closing them, focus should be visible on the
element which opened it.

## What was changed: 
1. Cleaned up `generate_api_key_panel.tsx`. No need to open
`GenerateApiKeyModal` from this level. Same logic duplicated in
`APIGettingStarted` inner component

## Screen


https://github.com/user-attachments/assets/46a23fdd-ba54-4798-9cb7-a78e28d447b8
  • Loading branch information
alexwizp authored Oct 21, 2024
1 parent d7e48fd commit 47a497c
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@

import React from 'react';

import { useActions, useValues } from 'kea';
import { useValues } from 'kea';

import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import { GenerateApiKeyModal } from './components/generate_api_key_modal/modal';

import { APIGettingStarted } from './components/getting_started/getting_started';
import { IndexViewLogic } from './index_view_logic';
import { OverviewLogic } from './overview.logic';

export const GenerateApiKeyPanel: React.FC = () => {
const { isGenerateModalOpen } = useValues(OverviewLogic);
const { indexName, isHiddenIndex } = useValues(IndexViewLogic);
const { closeGenerateModal } = useActions(OverviewLogic);
const { isHiddenIndex } = useValues(IndexViewLogic);

return (
<>
{isGenerateModalOpen && (
<GenerateApiKeyModal indexName={indexName} onClose={closeGenerateModal} />
)}
<EuiFlexGroup>
<EuiFlexItem>
<EuiPanel hasBorder paddingSize="xl">
Expand Down

0 comments on commit 47a497c

Please sign in to comment.