mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* fix double-announce of space name in other screen readers * announce 'Select your space' when loading the space selector screen * snapshot updates
This commit is contained in:
parent
050ee39d7d
commit
3c65756484
4 changed files with 16 additions and 2 deletions
|
@ -11,6 +11,7 @@ exports[`removes aria-label when instructed not to announce the space name 1`] =
|
|||
}
|
||||
>
|
||||
<EuiAvatar
|
||||
aria-hidden={true}
|
||||
aria-label=""
|
||||
color="#BFA180"
|
||||
data-test-subj="space-avatar-"
|
||||
|
@ -21,6 +22,7 @@ exports[`removes aria-label when instructed not to announce the space name 1`] =
|
|||
type="space"
|
||||
>
|
||||
<div
|
||||
aria-hidden={true}
|
||||
aria-label=""
|
||||
className="euiAvatar euiAvatar--m euiAvatar--space"
|
||||
data-test-subj="space-avatar-"
|
||||
|
|
|
@ -29,6 +29,7 @@ export const SpaceAvatar: SFC<Props> = (props: Props) => {
|
|||
{...!announceSpaceName && {
|
||||
// provide empty aria-label so EUI doesn't try to provide its own
|
||||
'aria-label': '',
|
||||
'aria-hidden': true,
|
||||
}}
|
||||
size={size || 'm'}
|
||||
initialsLength={MAX_SPACE_INITIALS}
|
||||
|
|
|
@ -28,7 +28,9 @@ exports[`it renders without crashing 1`] = `
|
|||
size="l"
|
||||
textTransform="none"
|
||||
>
|
||||
<h1>
|
||||
<h1
|
||||
tabIndex={0}
|
||||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Select your space"
|
||||
id="xpack.spaces.spaceSelector.selectSpacesTitle"
|
||||
|
|
|
@ -37,6 +37,7 @@ interface State {
|
|||
}
|
||||
|
||||
class SpaceSelectorUI extends Component<Props, State> {
|
||||
private headerRef?: HTMLElement | null;
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
|
@ -53,6 +54,14 @@ class SpaceSelectorUI extends Component<Props, State> {
|
|||
this.state = state;
|
||||
}
|
||||
|
||||
public setHeaderRef = (ref: HTMLElement | null) => {
|
||||
this.headerRef = ref;
|
||||
// forcing focus of header for screen readers to announce on page load
|
||||
if (this.headerRef) {
|
||||
this.headerRef.focus();
|
||||
}
|
||||
};
|
||||
|
||||
public componentDidMount() {
|
||||
if (this.state.spaces.length === 0) {
|
||||
this.loadSpaces();
|
||||
|
@ -93,7 +102,7 @@ class SpaceSelectorUI extends Component<Props, State> {
|
|||
</span>
|
||||
|
||||
<EuiTitle size="l">
|
||||
<h1>
|
||||
<h1 tabIndex={0} ref={this.setHeaderRef}>
|
||||
<FormattedMessage
|
||||
id="xpack.spaces.spaceSelector.selectSpacesTitle"
|
||||
defaultMessage="Select your space"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue