mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-12 19:06:13 +00:00
Merge pull request #1570 from jsit/fix/a11y-fixes-2
fix(a11y): Fixing some small a11y issues
This commit is contained in:
commit
43c9c8da3f
|
@ -276,10 +276,7 @@ hr {
|
||||||
}
|
}
|
||||||
|
|
||||||
.mini-overlay {
|
.mini-overlay {
|
||||||
position: absolute;
|
display: block;
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
padding: 2px;
|
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
|
|
|
@ -50,6 +50,7 @@ export class EmojiPicker extends Component<EmojiPickerProps, EmojiPickerState> {
|
||||||
pickerOptions={{}}
|
pickerOptions={{}}
|
||||||
></EmojiMart>
|
></EmojiMart>
|
||||||
</div>
|
</div>
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||||
<div
|
<div
|
||||||
onClick={linkEvent(this, this.togglePicker)}
|
onClick={linkEvent(this, this.togglePicker)}
|
||||||
className="click-away-container"
|
className="click-away-container"
|
||||||
|
|
|
@ -36,7 +36,9 @@ export class ImageUploadForm extends Component<
|
||||||
<label htmlFor={this.id} className="pointer text-muted small fw-bold">
|
<label htmlFor={this.id} className="pointer text-muted small fw-bold">
|
||||||
{this.props.imageSrc ? (
|
{this.props.imageSrc ? (
|
||||||
<span className="d-inline-block position-relative">
|
<span className="d-inline-block position-relative">
|
||||||
|
{/* TODO: Create "Current Iamge" translation for alt text */}
|
||||||
<img
|
<img
|
||||||
|
alt=""
|
||||||
src={this.props.imageSrc}
|
src={this.props.imageSrc}
|
||||||
height={this.props.rounded ? 60 : ""}
|
height={this.props.rounded ? 60 : ""}
|
||||||
width={this.props.rounded ? 60 : ""}
|
width={this.props.rounded ? 60 : ""}
|
||||||
|
@ -44,12 +46,14 @@ export class ImageUploadForm extends Component<
|
||||||
this.props.rounded ? "rounded-circle" : ""
|
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)}
|
onClick={linkEvent(this, this.handleRemoveImage)}
|
||||||
aria-label={I18NextService.i18n.t("remove")}
|
aria-label={I18NextService.i18n.t("remove")}
|
||||||
>
|
>
|
||||||
<Icon icon="x" classes="mini-overlay" />
|
<Icon icon="x" classes="mini-overlay" />
|
||||||
</a>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="btn btn-secondary">{this.props.uploadTitle}</span>
|
<span className="btn btn-secondary">{this.props.uploadTitle}</span>
|
||||||
|
|
|
@ -106,8 +106,12 @@ export class SearchableSelect extends Component<
|
||||||
<button
|
<button
|
||||||
id={id}
|
id={id}
|
||||||
type="button"
|
type="button"
|
||||||
|
role="combobox"
|
||||||
className="form-select d-inline-block text-start"
|
className="form-select d-inline-block text-start"
|
||||||
aria-haspopup="listbox"
|
aria-haspopup="listbox"
|
||||||
|
aria-controls="searchable-select-input"
|
||||||
|
aria-activedescendant={options[selectedIndex].label}
|
||||||
|
aria-expanded={false}
|
||||||
data-bs-toggle="dropdown"
|
data-bs-toggle="dropdown"
|
||||||
onClick={linkEvent(this, focusSearch)}
|
onClick={linkEvent(this, focusSearch)}
|
||||||
ref={this.toggleButtonRef}
|
ref={this.toggleButtonRef}
|
||||||
|
@ -116,17 +120,14 @@ export class SearchableSelect extends Component<
|
||||||
? `${I18NextService.i18n.t("loading")}${loadingEllipses}`
|
? `${I18NextService.i18n.t("loading")}${loadingEllipses}`
|
||||||
: options[selectedIndex].label}
|
: options[selectedIndex].label}
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div className="modlog-choices-font-size dropdown-menu w-100 p-2">
|
||||||
role="combobox"
|
|
||||||
aria-activedescendant={options[selectedIndex].label}
|
|
||||||
className="modlog-choices-font-size dropdown-menu w-100 p-2"
|
|
||||||
>
|
|
||||||
<div className="input-group">
|
<div className="input-group">
|
||||||
<span className="input-group-text">
|
<span className="input-group-text">
|
||||||
{loading ? <Spinner /> : <Icon icon="search" />}
|
{loading ? <Spinner /> : <Icon icon="search" />}
|
||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
id="searchable-select-input"
|
||||||
className="form-control"
|
className="form-control"
|
||||||
ref={this.searchInputRef}
|
ref={this.searchInputRef}
|
||||||
onInput={linkEvent(this, handleSearch)}
|
onInput={linkEvent(this, handleSearch)}
|
||||||
|
|
Loading…
Reference in a new issue