Skip to content

Commit

Permalink
Fix VO announcing EuiInlineEditText as clickable in read only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed May 23, 2023
1 parent bd4118c commit 0f483bd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/inline_edit/inline_edit_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,15 @@ export const EuiInlineEditForm: FunctionComponent<EuiInlineEditFormProps> = ({
readModeDescribedById,
readModeProps?.['aria-describedby']
)}
onClick={(e: MouseEvent<HTMLButtonElement>) => {
activateEditMode();
readModeProps?.onClick?.(e);
}}
onClick={
// `undefined` prevents screen readers from announcing "clickable" when the button is readonly
!isReadOnly
? (e: MouseEvent<HTMLButtonElement>) => {
activateEditMode();
readModeProps?.onClick?.(e);
}
: undefined
}
>
{children(readModeValue)}
</EuiButtonEmpty>
Expand Down

0 comments on commit 0f483bd

Please sign in to comment.