Skip to content

Commit

Permalink
[App Search] Misc credentials key UI enhancements (#81817)
Browse files Browse the repository at this point in the history
* Fix screen reader still reading out bullet bullet bullet

* Even out horizontal spacing

* Break long password text

* Make EUI table cell full width on mobile
  • Loading branch information
Constance authored Dec 23, 2020
1 parent 62b5ef9 commit e389605
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ describe('Credentials', () => {
copy: expect.any(Function),
toggleIsHidden: expect.any(Function),
isHidden: expect.any(Boolean),
text: <span aria-label="Hidden text">•••••••</span>,
text: (
<span aria-label="Hidden text">
<span aria-hidden={true}>•••••••</span>
</span>
),
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const CredentialsList: React.FC = () => {
{
name: 'Key',
width: '36%',
className: 'eui-textBreakAll',
render: (token: ApiToken) => {
const { key } = token;
if (!key) return null;
Expand All @@ -60,6 +61,10 @@ export const CredentialsList: React.FC = () => {
</EuiCopy>
);
},
mobileOptions: {
// @ts-ignore - EUI's type definitions need to be updated
width: '100%',
},
},
{
name: 'Modes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const Key: React.FC<Props> = ({ copy, toggleIsHidden, isHidden, text }) =
iconType={hideIcon}
aria-label={hideIconLabel}
aria-pressed={!isHidden}
style={{ marginRight: '0.25em' }}
/>
{text}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const HiddenText: React.FC<Props> = ({ text, children }) => {
defaultMessage: 'Hidden text',
});
const hiddenText = isHidden ? (
<span aria-label={hiddenLabel}>{text.replace(/./g, '•')}</span>
<span aria-label={hiddenLabel}>
<span aria-hidden={true}>{text.replace(/./g, '•')}</span>
</span>
) : (
text
);
Expand Down

0 comments on commit e389605

Please sign in to comment.