Skip to content

Commit 80fc981

Browse files
committed
Auto-fix violations of the @elastic/eui/sr_output_disabled_tooltip ESLint rule (#227044)
## Summary This PR applies the auto-fix for the newly introduced `@elastic/eui/sr_output_disabled_tooltip` ESLint rule across the codebase. The rule ensures proper accessibility behavior by adding `disableScreenReaderOutput` prop to `EuiToolTip` components when their content duplicates the trigger button's `aria-label`. ## Changes - Auto-fixed instances where `EuiToolTip` components need `disableScreenReaderOutput` prop to prevent redundant screen reader announcements ## Related - elastic/eui#8848 (cherry picked from commit e3e50ea) # Conflicts: # x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/index.tsx
1 parent e341bce commit 80fc981

96 files changed

Lines changed: 198 additions & 121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/files_example/public/components/confirm_button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ConfirmButtonIcon: FunctionComponent<Props> = ({
2626
const [showConfirm, setShowConfirm] = useState(false);
2727

2828
return showConfirm ? (
29-
<EuiToolTip content={confirmationText}>
29+
<EuiToolTip content={confirmationText} disableScreenReaderOutput>
3030
<EuiButtonIcon
3131
disabled={disabled}
3232
aria-label={confirmationText}

src/platform/packages/private/kbn-esql-editor/src/editor_footer/history_starred_queries.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ export function QueryList({
279279
content={i18n.translate('esqlEditor.query.esqlQueriesListRun', {
280280
defaultMessage: 'Run query',
281281
})}
282+
disableScreenReaderOutput
282283
>
283284
<EuiButtonIcon
284285
iconType="play"

src/platform/packages/private/kbn-esql-editor/src/editor_footer/keyboard_shortcuts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function KeyboardShortcuts() {
8383
anchorPosition="downRight"
8484
panelPaddingSize="none"
8585
button={
86-
<EuiToolTip content={label} delay="long">
86+
<EuiToolTip content={label} delay="long" disableScreenReaderOutput>
8787
<EuiButtonIcon
8888
size="xs"
8989
iconType="keyboard"

src/platform/packages/private/kbn-esql-editor/src/editor_footer/query_wrap_component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function QueryWrapComponent({
3636
defaultMessage: 'Add line breaks on pipes',
3737
})
3838
}
39+
disableScreenReaderOutput
3940
>
4041
<EuiButtonIcon
4142
iconType={isWrappedByPipes ? 'pipeNoBreaks' : 'pipeBreaks'}

src/platform/packages/shared/kbn-alerts-ui-shared/src/alert_filter_controls/buttons.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ interface AddControlProps extends Partial<EuiButtonIconProps> {
2727
export const AddControl: FC<AddControlProps> = ({ onClick, ...rest }) => {
2828
const { isDisabled } = rest;
2929
return (
30-
<EuiToolTip content={isDisabled ? ADD_CONTROLS_MAX_LIMIT : ADD_CONTROLS}>
30+
<EuiToolTip
31+
content={isDisabled ? ADD_CONTROLS_MAX_LIMIT : ADD_CONTROLS}
32+
disableScreenReaderOutput
33+
>
3134
<EuiButtonIcon
3235
size="s"
3336
iconSize="m"

src/platform/packages/shared/kbn-cell-actions/src/components/extra_actions_button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ExtraActionsButton: React.FC<ExtraActionsButtonProps> = ({
2525
extraActionsColor,
2626
}) => {
2727
return showTooltip ? (
28-
<EuiToolTip content={SHOW_MORE_ACTIONS}>
28+
<EuiToolTip content={SHOW_MORE_ACTIONS} disableScreenReaderOutput>
2929
<EuiButtonIcon
3030
data-test-subj="showExtraActionsButton"
3131
aria-label={SHOW_MORE_ACTIONS}

src/platform/packages/shared/kbn-unified-data-table/src/components/custom_control_columns/additional_row_control/row_menu_control_column.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const RowMenuControlCell = ({
7777
id={`rowMenuActionsPopover_${props.rowIndex}`}
7878
className="unifiedDataTable__rowControl"
7979
button={
80-
<EuiToolTip content={buttonLabel} delay="long">
80+
<EuiToolTip content={buttonLabel} delay="long" disableScreenReaderOutput>
8181
<EuiButtonIcon
8282
data-test-subj={`unifiedDataTable_additionalRowControl_${props.columnId}Menu`}
8383
iconSize="s"

src/platform/packages/shared/kbn-unified-data-table/src/components/data_table_expand_button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const ExpandButton = (props: EuiDataGridCellValueElementProps) => {
5353
delay="long"
5454
ref={toolTipRef}
5555
anchorClassName="unifiedDataTable__rowControl"
56+
disableScreenReaderOutput
5657
>
5758
<EuiButtonIcon
5859
id={rowIndex === 0 ? tourStep : undefined}

src/platform/packages/shared/kbn-unified-field-list/src/components/field_item_button/__snapshots__/field_item_button.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/platform/packages/shared/kbn-unified-field-list/src/components/field_item_button/field_item_button.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export function FieldItemButton<T extends FieldListItem = DataViewField>({
140140
<EuiToolTip
141141
key={`selected-to-remove-${field.name}-${removeFieldFromWorkspaceTooltip}`}
142142
content={removeFieldFromWorkspaceTooltip}
143+
disableScreenReaderOutput
143144
>
144145
<EuiButtonIcon
145146
data-test-subj={`fieldToggle-${field.name}`}
@@ -163,6 +164,7 @@ export function FieldItemButton<T extends FieldListItem = DataViewField>({
163164
<EuiToolTip
164165
key={`deselected-to-add-${field.name}-${addFieldToWorkspaceTooltip}`}
165166
content={addFieldToWorkspaceTooltip}
167+
disableScreenReaderOutput
166168
>
167169
<EuiButtonIcon
168170
data-test-subj={`fieldToggle-${field.name}`}

0 commit comments

Comments
 (0)