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

fix(a11y): Fixing some small a11y issues #1570

Merged
merged 7 commits into from
Jun 25, 2023
Merged
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
5 changes: 1 addition & 4 deletions src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ hr {
}

.mini-overlay {
position: absolute;
top: 0;
right: 0;
padding: 2px;
display: block;
height: 1.5em;
width: 1.5em;
background: rgba(0, 0, 0, 0.4);
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/common/emoji-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class EmojiPicker extends Component<EmojiPickerProps, EmojiPickerState> {
pickerOptions={{}}
></EmojiMart>
</div>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<div
onClick={linkEvent(this, this.togglePicker)}
className="click-away-container"
Expand Down
8 changes: 6 additions & 2 deletions src/shared/components/common/image-upload-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@ export class ImageUploadForm extends Component<
<label htmlFor={this.id} className="pointer text-muted small fw-bold">
{this.props.imageSrc ? (
<span className="d-inline-block position-relative">
{/* TODO: Create "Current Iamge" translation for alt text */}
<img
alt=""
src={this.props.imageSrc}
height={this.props.rounded ? 60 : ""}
width={this.props.rounded ? 60 : ""}
className={`img-fluid ${
this.props.rounded ? "rounded-circle" : ""
}`}
/>
<a
<button
className="position-absolute d-block p-0 end-0 border-0 top-0 bg-transparent text-white"
type="button"
onClick={linkEvent(this, this.handleRemoveImage)}
aria-label={I18NextService.i18n.t("remove")}
>
<Icon icon="x" classes="mini-overlay" />
</a>
</button>
</span>
) : (
<span className="btn btn-secondary">{this.props.uploadTitle}</span>
Expand Down
11 changes: 6 additions & 5 deletions src/shared/components/common/searchable-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ export class SearchableSelect extends Component<
<button
id={id}
type="button"
role="combobox"
className="form-select d-inline-block text-start"
aria-haspopup="listbox"
aria-controls="searchable-select-input"
aria-activedescendant={options[selectedIndex].label}
aria-expanded={false}
data-bs-toggle="dropdown"
onClick={linkEvent(this, focusSearch)}
ref={this.toggleButtonRef}
Expand All @@ -116,17 +120,14 @@ export class SearchableSelect extends Component<
? `${I18NextService.i18n.t("loading")}${loadingEllipses}`
: options[selectedIndex].label}
</button>
<div
role="combobox"
aria-activedescendant={options[selectedIndex].label}
jsit marked this conversation as resolved.
Show resolved Hide resolved
className="modlog-choices-font-size dropdown-menu w-100 p-2"
>
<div className="modlog-choices-font-size dropdown-menu w-100 p-2">
<div className="input-group">
<span className="input-group-text">
{loading ? <Spinner /> : <Icon icon="search" />}
</span>
<input
type="text"
id="searchable-select-input"
className="form-control"
ref={this.searchInputRef}
onInput={linkEvent(this, handleSearch)}
Expand Down