Give focused status a sensible aria-label for screen readers (#8387)

* Give focused status a sensible aria-label for screen readers

Fix #8192

* Use content warning in aria-label unless expanded
This commit is contained in:
Eugen Rochko
2018-08-23 20:56:57 +02:00
committed by GitHub
parent 43b8df3228
commit 248df68c36
2 changed files with 26 additions and 5 deletions

View File

@ -43,6 +43,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
import { boostModal, deleteModal } from '../../initial_state';
import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../ui/util/fullscreen';
import { textForScreenReader } from '../../components/status';
const messages = defineMessages({
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
@ -418,7 +419,7 @@ export default class Status extends ImmutablePureComponent {
{ancestors}
<HotKeys handlers={handlers}>
<div className='focusable' tabIndex='0'>
<div className='focusable' tabIndex='0' aria-label={textForScreenReader(intl, status, false, !status.get('hidden'))}>
<DetailedStatus
status={status}
onOpenVideo={this.handleOpenVideo}