[MM-61604]: Provide proper name, role, and state information to skin tone accordion (#29742)
* [MA-30]: Provide state information * [MA-30]: Update aria attributes * [MA-30]: Remove unnecessary id --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0085826203
Коммит
3f9aa4a212
@@ -131,6 +131,7 @@ export class EmojiPickerSkin extends React.PureComponent<Props, State> {
|
|||||||
onClick={() => this.hideSkinTonePicker(skin)}
|
onClick={() => this.hideSkinTonePicker(skin)}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
alt={skinTone.label.defaultMessage}
|
||||||
src={imgTrans}
|
src={imgTrans}
|
||||||
className={spriteClassName}
|
className={spriteClassName}
|
||||||
/>
|
/>
|
||||||
@@ -144,6 +145,9 @@ export class EmojiPickerSkin extends React.PureComponent<Props, State> {
|
|||||||
className='skin-tones__close-icon style--none'
|
className='skin-tones__close-icon style--none'
|
||||||
onClick={() => this.hideSkinTonePicker(this.props.userSkinTone)}
|
onClick={() => this.hideSkinTonePicker(this.props.userSkinTone)}
|
||||||
aria-label={closeButtonLabel}
|
aria-label={closeButtonLabel}
|
||||||
|
aria-expanded={this.state.pickerExtended}
|
||||||
|
tabIndex={0}
|
||||||
|
aria-controls='skin-tones-icons'
|
||||||
>
|
>
|
||||||
<CloseIcon
|
<CloseIcon
|
||||||
size={16}
|
size={16}
|
||||||
@@ -156,7 +160,12 @@ export class EmojiPickerSkin extends React.PureComponent<Props, State> {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='skin-tones__icons'>
|
<div
|
||||||
|
className='skin-tones__icons'
|
||||||
|
id='skin-tones-icons'
|
||||||
|
aria-label='Skin tone icons'
|
||||||
|
role='region'
|
||||||
|
>
|
||||||
{choices}
|
{choices}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@@ -180,6 +189,8 @@ export class EmojiPickerSkin extends React.PureComponent<Props, State> {
|
|||||||
className='style--none skin-tones__icon skin-tones__expand-icon'
|
className='style--none skin-tones__icon skin-tones__expand-icon'
|
||||||
onClick={this.showSkinTonePicker}
|
onClick={this.showSkinTonePicker}
|
||||||
aria-label={expandButtonLabel}
|
aria-label={expandButtonLabel}
|
||||||
|
aria-controls='skin-tones-icons'
|
||||||
|
aria-expanded={this.state.pickerExtended}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={'emoji skin tone picker'}
|
alt={'emoji skin tone picker'}
|
||||||
@@ -199,8 +210,11 @@ export class EmojiPickerSkin extends React.PureComponent<Props, State> {
|
|||||||
timeout={200}
|
timeout={200}
|
||||||
>
|
>
|
||||||
<div className={classNames('skin-tones', {'skin-tones--active': this.state.pickerExtended})}>
|
<div className={classNames('skin-tones', {'skin-tones--active': this.state.pickerExtended})}>
|
||||||
<div className={classNames('skin-tones__content', {'skin-tones__content__single': !this.state.pickerExtended})}>
|
<div
|
||||||
{this.state.pickerExtended ? this.extended() : this.collapsed()}
|
className={classNames('skin-tones__content', {'skin-tones__content__single': !this.state.pickerExtended})}
|
||||||
|
aria-orientation='horizontal'
|
||||||
|
>
|
||||||
|
{this.state.pickerExtended ? this.extended() : this.collapsed() }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CSSTransition>
|
</CSSTransition>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user