Skip to content

Commit

Permalink
fix: [Stateful: Home page] Most Ingest your content section buttons h…
Browse files Browse the repository at this point in the history
…ave duplicated actions on them (elastic#196079)

Closes: elastic#194932

## Summary

User reaches the same button two times when navigating using only
keyboard and it can get confusing. Also for the user using screen reader
it is also confusing if reached element is button or link. Better for
element to get focus only one time when navigating in sequence from one
element to another and for the user only to hear one announcement of the
element, button or link (but not button link).

## What was changed?:

1. Removed extra `EuiLinkTo` wrapper 
2. `EuiButton` was replaced to `EuiButtonTo`

## Screen 

<img width="1792" alt="image"
src="https://github.com/user-attachments/assets/597eb7f0-dd7b-4c14-bccd-d91dc3bdcbcf">
  • Loading branch information
alexwizp authored Oct 15, 2024
1 parent 23e0e1e commit 5ed6981
Showing 1 changed file with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

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

import { EuiLinkTo } from '../../../../shared/react_router_helpers';
import { EuiButtonTo } from '../../../../shared/react_router_helpers';

interface IngestionCardProps {
buttonIcon: IconType;
Expand Down Expand Up @@ -78,15 +78,25 @@ export const IngestionCard: React.FC<IngestionCardProps> = ({
}
footer={
onClick ? (
<EuiButton isDisabled={isDisabled} iconType={buttonIcon} onClick={onClick} fullWidth>
<EuiButton
data-test-subj="enterpriseSearchIngestionCardButton"
isDisabled={isDisabled}
iconType={buttonIcon}
onClick={onClick}
fullWidth
>
{buttonLabel}
</EuiButton>
) : (
<EuiLinkTo to={href ?? ''} shouldNotCreateHref>
<EuiButton isDisabled={isDisabled} iconType={buttonIcon} fullWidth>
{buttonLabel}
</EuiButton>
</EuiLinkTo>
<EuiButtonTo
to={href ?? ''}
shouldNotCreateHref
isDisabled={isDisabled}
iconType={buttonIcon}
fullWidth
>
{buttonLabel}
</EuiButtonTo>
)
}
/>
Expand Down

0 comments on commit 5ed6981

Please sign in to comment.