Skip to content

Commit 0f483bd

Browse files
committed
Fix VO announcing EuiInlineEditText as clickable in read only mode
1 parent bd4118c commit 0f483bd

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/components/inline_edit/inline_edit_form.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,15 @@ export const EuiInlineEditForm: FunctionComponent<EuiInlineEditFormProps> = ({
332332
readModeDescribedById,
333333
readModeProps?.['aria-describedby']
334334
)}
335-
onClick={(e: MouseEvent<HTMLButtonElement>) => {
336-
activateEditMode();
337-
readModeProps?.onClick?.(e);
338-
}}
335+
onClick={
336+
// `undefined` prevents screen readers from announcing "clickable" when the button is readonly
337+
!isReadOnly
338+
? (e: MouseEvent<HTMLButtonElement>) => {
339+
activateEditMode();
340+
readModeProps?.onClick?.(e);
341+
}
342+
: undefined
343+
}
339344
>
340345
{children(readModeValue)}
341346
</EuiButtonEmpty>

0 commit comments

Comments
 (0)