Skip to content

Commit

Permalink
Fix accessibility violations
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalnavneet authored and tekton-robot committed Nov 24, 2022
1 parent f616c8f commit 8a6d4f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ const FormattedDateWrapper = ({
);
}

const formattedDate = intl.formatDate(date, {
let formattedDate = intl.formatDate(date, {
day: 'numeric',
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric'
});

return <span title={formatTooltip(formattedDate)}>{content}</span>;
formattedDate = formatTooltip(formattedDate);
return (
<span title={formattedDate} aria-label={formattedDate}>
{content}
</span>
);
};

export default FormattedDateWrapper;
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class FormattedDurationWrapper extends Component {
this.durationNode = ref;
}}
title={this.state.tooltip}
aria-label={this.state.tooltip}
>
<FormattedDuration
format="{days} {hours} {minutes} {seconds}"
Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/components/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {
} from 'carbon-components-react';

const TabContent = ({ selected, ...other }) =>
selected && <CarbonTabContent selected={selected} {...other} />;
selected ? (
<CarbonTabContent selected={selected} {...other} />
) : (
<span className="tkn--visually-hidden" id={other.id} />
);

const Tabs = ({ children, ...other }) => (
<CarbonTabs {...other}>
Expand Down

0 comments on commit 8a6d4f3

Please sign in to comment.