Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make clickable elements reachable by keyboard users #7822

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions css/_welcome_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ body.welcome-page {
font-size: $welcomePageButtonFontSize;
font-weight: $welcomePageButtonFontWeight;
background: #0074E0;
border: none;
border-radius: $welcomePageButtonBorderRadius;
box-shadow: none;
color: #FFFFFF;
text-align: center;
vertical-align: middle;
Expand Down
4 changes: 3 additions & 1 deletion react/features/base/buttons/CopyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ function CopyButton({ className, displayedText, textToCopy, textOnHover, textOnC
className = { `${className} copy-button${isClicked ? ' clicked' : ''}` }
onClick = { onClick }
onMouseOut = { onHoverOut }
onMouseOver = { onHoverIn }>
onMouseOver = { onHoverIn }
role = 'button'
tabIndex = { 0 }>
{ renderContent() }
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion react/features/base/icons/components/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ export default function Icon(props: Props) {
} = styleTypeToObject(style ?? {});
const calculatedColor = color ?? styleColor ?? DEFAULT_COLOR;
const calculatedSize = size ?? styleSize ?? DEFAULT_SIZE;
const a11yClickable = onClick ? {
role: 'button',
tabIndex: 0
} : {};

return (
<Container
className = { `jitsi-icon ${className}` }
onClick = { onClick }
style = { restStyle }>
style = { restStyle }
{ ...a11yClickable }>
<IconComponent
fill = { calculatedColor }
height = { calculatedSize }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ class ParticipantView extends Component<Props> {
return (
<Container
onClick = { renderVideo || renderYoutubeLargeVideo ? undefined : onPress }
role = 'button'
style = {{
...styles.participantView,
...this.props.style
}}
tabIndex = { 0 }
touchFeedback = { false }>

<TestHint
Expand Down
8 changes: 6 additions & 2 deletions react/features/base/premeeting/components/web/ActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ function ActionButton({
<div
className = { `action-btn ${className} ${type} ${disabled ? 'disabled' : ''}` }
data-testid = { testId ? testId : undefined }
onClick = { disabled ? undefined : onClick }>
onClick = { disabled ? undefined : onClick }
role = 'button'
tabIndex = { 0 }>
{children}
{hasOptions && <div
className = 'options'
data-testid = 'prejoin.joinOptions'
onClick = { disabled ? undefined : onOptionsClick }>
onClick = { disabled ? undefined : onOptionsClick }
role = 'button'
tabIndex = { 0 }>
<Icon
className = 'icon'
size = { 14 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ class CopyMeetingUrl extends Component<Props, State> {
onMouseLeave = { _hideCopyLink }>
<div
className = { `url ${showLinkCopied ? 'done' : ''}` }
onClick = { _copyUrl } >
onClick = { _copyUrl }
role = 'button'
tabIndex = { 0 }>
<div className = 'copy-meeting-text'>
{ !showCopyLink && !showLinkCopied && getDecodedURI(url) }
{ showCopyLink && t('prejoin.copyAndShare') }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function ToggleButton({ children, isToggled, onClick }: Props) {
return (
<div
className = { className }
onClick = { onClick }>
onClick = { onClick }
role = 'button'
tabIndex = { 0 }>
<div className = 'toggle-button-container'>
<div className = 'toggle-button-icon-container'>
<Icon
Expand Down
2 changes: 2 additions & 0 deletions react/features/base/react/components/native/AvatarListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export default class AvatarListItem extends Component<Props> {
<Container
onClick = { onPress }
onLongPress = { onLongPress }
role = 'button'
style = { styles.listItem }
tabIndex = { 0 }
underlayColor = { UNDERLAY_COLOR }>
<Avatar
colorBase = { colorBase }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export default class NavigateSectionListItem extends Component<Props> {
return (
<Container
onClick = { secondaryAction }
style = { styles.secondaryActionContainer }>
role = 'button'
style = { styles.secondaryActionContainer }
tabIndex = { 0 }>
<Text style = { styles.secondaryActionLabel }>+</Text>
</Container>
);
Expand Down
4 changes: 3 additions & 1 deletion react/features/base/react/components/web/MeetingsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export default class MeetingsList extends Component<Props> {
<Container
className = { rootClassName }
key = { index }
onClick = { onPress }>
onClick = { onPress }
role = 'button'
tabIndex = { 0 }>
<Container className = 'left-column'>
<Text className = 'date'>
{ _toDateString(date) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export default class NavigateSectionListItem<P: Props>
return (
<Container
className = { rootClassName }
onClick = { onPress }>
onClick = { onPress }
role = 'button'
tabIndex = { 0 }>
<Container className = 'navigate-section-list-tile-info'>
<Text
className = 'navigate-section-tile-title'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ class OverflowMenuItem extends Component<Props> {
<li
aria-label = { accessibilityLabel }
className = { className }
onClick = { disabled ? null : onClick }>
onClick = { disabled ? null : onClick }
role = 'button'
tabIndex = { 0 }>
<span className = 'overflow-menu-item-icon'>
<Icon
id = { iconId }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class AddMeetingUrlButton extends Component<Props> {
<Tooltip content = { this.props.t('calendarSync.addMeetingURL') }>
<div
className = 'button add-button'
onClick = { this._onClick }>
onClick = { this._onClick }
role = 'button'
tabIndex = { 0 }>
<Icon src = { IconAdd } />
</div>
</Tooltip>
Expand Down
16 changes: 12 additions & 4 deletions react/features/calendar-sync/components/CalendarList.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,18 @@ class CalendarList extends AbstractPage<Props> {
{ showSettingsButton
&& <div
className = 'button'
onClick = { this._onOpenSettings }>
onClick = { this._onOpenSettings }
role = 'button'
tabIndex = { 0 }>
{ t('calendarSync.permissionButton') }
</div>
}
{ showRefreshButton
&& <div
className = 'button'
onClick = { this._onRefreshEvents }>
onClick = { this._onRefreshEvents }
role = 'button'
tabIndex = { 0 }>
{ t('calendarSync.refresh') }
</div>
}
Expand Down Expand Up @@ -167,7 +171,9 @@ class CalendarList extends AbstractPage<Props> {
</p>
<div
className = 'button'
onClick = { this._onRefreshEvents }>
onClick = { this._onRefreshEvents }
role = 'button'
tabIndex = { 0 }>
{ t('calendarSync.refresh') }
</div>
</div>
Expand All @@ -193,7 +199,9 @@ class CalendarList extends AbstractPage<Props> {
</p>
<div
className = 'button'
onClick = { this._onOpenSettings }>
onClick = { this._onOpenSettings }
role = 'button'
tabIndex = { 0 }>
{ t('welcomepage.connectCalendarButton') }
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion react/features/calendar-sync/components/JoinButton.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class JoinButton extends Component<Props> {
content = { t('calendarSync.joinTooltip') }>
<div
className = 'button join-button'
onClick = { this._onClick }>
onClick = { this._onClick }
role = 'button'
tabIndex = { 0 }>
{ t('calendarSync.join') }
</div>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default class MicrosoftSignInButton extends Component<Props> {
return (
<div
className = 'microsoft-sign-in'
onClick = { this.props.onClick }>
onClick = { this.props.onClick }
role = 'button'
tabIndex = { 0 }>
<img
className = 'microsoft-logo'
src = 'images/microsoftLogo.svg' />
Expand Down
4 changes: 3 additions & 1 deletion react/features/chat/components/web/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ class Chat extends AbstractChat<Props> {
<div className = 'chat-header'>
<div
className = 'chat-close'
onClick = { this.props._onToggleChat }>
onClick = { this.props._onToggleChat }
role = 'button'
tabIndex = { 0 }>
<Icon src = { IconClose } />
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions react/features/chat/components/web/ChatInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class ChatInput extends Component<Props, State> {
<div id = 'smileys'>
<Emoji
onClick = { this._onToggleSmileysPanel }
role = 'button'
tabIndex = { 0 }
text = ':)' />
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion react/features/chat/components/web/MessageRecipient.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class MessageRecipient extends AbstractMessageRecipient<Props> {
recipient: _privateMessageRecipient
}) }
</span>
<div onClick = { this.props._onRemovePrivateMessageRecipient }>
<div
onClick = { this.props._onRemovePrivateMessageRecipient }
role = 'button'
tabIndex = { 0 }>
<Icon
src = { IconCancelSelection } />
</div>
Expand Down
2 changes: 2 additions & 0 deletions react/features/chat/components/web/SmileysPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class SmileysPanel extends PureComponent<Props> {
<Emoji
onClick = { onSelectFunction }
onlyEmojiClassName = 'smiley'
role = 'button'
tabIndex = { 0 }
text = { smileys[smileyKey] } />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
</div>
<div
className = 'chrome-extension-banner__close-container'
onClick = { this._onClosePressed }>
onClick = { this._onClosePressed }
role = 'button'
tabIndex = { 0 }>
<Icon
className = 'gray'
size = { 12 }
Expand All @@ -255,7 +257,9 @@ class ChromeExtensionBanner extends PureComponent<Props, State> {
className = 'chrome-extension-banner__button-container'>
<div
className = 'chrome-extension-banner__button-open-url'
onClick = { this._onInstallExtensionClick }>
onClick = { this._onInstallExtensionClick }
role = 'button'
tabIndex = { 0 }>
<div
className = 'chrome-extension-banner__button-text'>
{ t('chromeExtensionBanner.buttonText') }
Expand Down
4 changes: 3 additions & 1 deletion react/features/conference/components/web/InviteMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ function InviteMore({
</div>
<div
className = 'invite-more-button'
onClick = { onClick }>
onClick = { onClick }
role = 'button'
tabIndex = { 0 }>
<Icon src = { IconInviteMore } />
<div className = 'invite-more-button-text'>
{t('addPeople.inviteMorePrompt')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class ParticipantsCount extends PureComponent<Props> {
return (
<div
className = 'participants-count'
onClick = { this._onClick }>
onClick = { this._onClick }
role = 'button'
tabIndex = { 0 }>
<span className = 'participants-count-number'>
{this.props.count}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class DesktopSourcePreview extends Component<Props> {
<div
className = { displayClasses }
onClick = { this._onClick }
onDoubleClick = { this._onDoubleClick }>
onDoubleClick = { this._onDoubleClick }
role = 'button'
tabIndex = { 0 }>
<div className = 'desktop-source-preview-image-container'>
<img
className = 'desktop-source-preview-thumbnail'
Expand Down
4 changes: 3 additions & 1 deletion react/features/display-name/components/web/DisplayName.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ class DisplayName extends Component<Props, State> {
<span
className = 'displayname'
id = { elementID }
onClick = { this._onStartEditing }>
onClick = { this._onStartEditing }
role = 'button'
tabIndex = { 0 }>
{ appendSuffix(_nameToDisplay, displayNameSuffix) }
</span>
);
Expand Down
4 changes: 3 additions & 1 deletion react/features/e2ee/components/E2EESection.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ class E2EESection extends Component<Props, State> {
{ !expand && description.substring(0, 100) }
{ !expand && <span
className = 'read-more'
onClick = { this._onExpand }>
onClick = { this._onExpand }
role = 'button'
tabIndex = { 0 }>
... { t('dialog.readMore') }
</span> }
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function EmbedMeetingTrigger({ t, openEmbedDialog }: Props) {
return (
<div
className = 'embed-meeting-trigger'
onClick = { onClick }>
onClick = { onClick }
role = 'button'
tabIndex = { 0 }>
{t('embedMeeting.title')}
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions react/features/filmstrip/components/native/Thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ function Thumbnail(props: Props) {
<Container
onClick = { _onClick }
onLongPress = { participant.local ? undefined : _onShowRemoteVideoMenu }
role = 'button'
style = { [
styles.thumbnail,
participant.pinned && !tileView
? _styles.thumbnailPinned : null,
props.styleOverrides || null
] }
tabIndex = { 0 }
touchFeedback = { false }>

<ParticipantView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class GoogleSignInButton extends AbstractGoogleSignInButton {
return (
<div
className = 'google-sign-in'
onClick = { this.props.onClick }>
onClick = { this.props.onClick }
role = 'button'
tabIndex = { 0 }>
<img
className = 'google-logo'
src = 'images/googleLogo.svg' />
Expand Down
Loading