mirror of
https://github.com/bitwarden/browser
synced 2025-12-30 23:23:52 +00:00
* Make <content> element explicitly non-focusable Some browsers (Firefox, upcoming versions of Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=585413) make containers with `overflow: auto` / `overflow: scroll` (and the `-x` / `-y` variants) keyboard-focusable. This leads to a very awkward experience for assistive technology users navigating through the extension window, as for every view, the entire `<content>` container receives focus (and screen readers try to announce all its content in one go) before you reach the actual first control. To counteract this behaviour, this adds an explicit `tabindex="-1"` to these elements. * Change `<content>` to `<main>` More semantically accurate. See https://github.com/bitwarden/browser/pull/2245#issuecomment-1104553312 * Update scss to target `main` instead of `content` * Change the previously existing `<main>` to generic `<div>`, tweak styles accordingly Can't have two separate `<main>` elements, especially not nested ones. The original `<main>` was really just a handy wrapper for the component, but semantically should be neutral
74 lines
2.5 KiB
HTML
74 lines
2.5 KiB
HTML
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise">
|
|
<header>
|
|
<div class="left">
|
|
<button type="button" appBlurClick (click)="close()" *ngIf="openedAttachmentsInPopup">
|
|
{{ "close" | i18n }}
|
|
</button>
|
|
<button type="button" appBlurClick (click)="back()" *ngIf="!openedAttachmentsInPopup">
|
|
<span class="header-icon"><i class="bwi bwi-angle-left" aria-hidden="true"></i></span>
|
|
<span>{{ "back" | i18n }}</span>
|
|
</button>
|
|
</div>
|
|
<h1 class="center">
|
|
<span class="title">{{ "attachments" | i18n }}</span>
|
|
</h1>
|
|
<div class="right">
|
|
<button type="submit" appBlurClick [disabled]="form.loading">
|
|
<span [hidden]="form.loading">{{ "save" | i18n }}</span>
|
|
<i class="bwi bwi-spinner bwi-lg bwi-spin" [hidden]="!form.loading" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
<main tabindex="-1">
|
|
<div class="box" *ngIf="cipher && cipher.hasAttachments">
|
|
<div class="box-content no-hover">
|
|
<div class="box-content-row box-content-row-flex" *ngFor="let a of cipher.attachments">
|
|
<div class="row-main">
|
|
{{ a.fileName }}
|
|
</div>
|
|
<small class="row-sub-label">{{ a.sizeName }}</small>
|
|
<div class="action-buttons no-pad">
|
|
<button
|
|
type="button"
|
|
class="row-btn btn"
|
|
type="button"
|
|
appStopClick
|
|
appBlurClick
|
|
appA11yTitle="{{ 'deleteAttachment' | i18n }}"
|
|
(click)="delete(a)"
|
|
#deleteBtn
|
|
[appApiAction]="deletePromises[a.id]"
|
|
[disabled]="deleteBtn.loading"
|
|
>
|
|
<i
|
|
class="bwi bwi-trash bwi-lg bwi-fw"
|
|
[hidden]="deleteBtn.loading"
|
|
aria-hidden="true"
|
|
></i>
|
|
<i
|
|
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
|
|
[hidden]="!deleteBtn.loading"
|
|
aria-hidden="true"
|
|
></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-header">
|
|
{{ "newAttachment" | i18n }}
|
|
</h2>
|
|
<div class="box-content no-hover">
|
|
<div class="box-content-row">
|
|
<label for="file">{{ "file" | i18n }}</label>
|
|
<input type="file" id="file" name="file" required />
|
|
</div>
|
|
</div>
|
|
<div class="box-footer">
|
|
{{ "maxFileSize" | i18n }}
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</form>
|