Merge remote-tracking branch 'lemmy/main' into feat/vote-components

* lemmy/main:
  fix(a11y): Restore aria-activedescendant
  chore: Empty commit to re-trigger Woodpecker
  fix(a11y): Make foreground of 'remove image button' white
  fix(a11y): Add alt text to emojis form
  fix(a11y): Fix some a11y markup in Searchable Select component
  fix(a11y): Change image remove button to true button element
  fix: Ignore rule for clickaway div; 'Esc' works for this
  fix: Fix another class
  fix: Fix some Bootstrap 5 font classes
This commit is contained in:
Jay Sitter 2023-06-25 01:15:57 -04:00
commit 731c407e31
4 changed files with 14 additions and 11 deletions

View file

@ -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);

View file

@ -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"

View file

@ -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>

View file

@ -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)}