fix: improve media upload a11y (#1240)

use ul/li instead of divs here
This commit is contained in:
Nolan Lawson 2019-05-27 12:31:42 -07:00 committed by GitHub
parent 37d3cac7d2
commit 482ee3d3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -1,18 +1,22 @@
{#if media.length}
<div class="compose-media-container" style="grid-template-columns: repeat({media.length}, 1fr);">
<ul class="compose-media-container"
aria-label="Media uploads"
style="grid-template-columns: repeat({media.length}, 1fr);"
>
{#each media as mediaItem, index}
<ComposeMediaItem {realm} {mediaItem} {index} {media} />
{/each}
</div>
</ul>
{/if}
<style>
.compose-media-container {
grid-area: media;
list-style: none;
display: grid;
grid-column-gap: 5px;
align-items: center;
justify-content: center;
margin-top: 10px;
margin: 10px 0 0 0;
background: var(--form-bg);
padding: 5px;
border-radius: 4px;

View File

@ -1,4 +1,4 @@
<div class="compose-media compose-media-realm-{realm}">
<li class="compose-media compose-media-realm-{realm}">
<img src={mediaItem.data.preview_url} {alt} />
<div class="compose-media-delete">
<button class="compose-media-delete-button"
@ -18,9 +18,11 @@
Describe {shortName} for the visually impaired
</label>
</div>
</div>
</li>
<style>
.compose-media {
margin: 0;
padding: 0;
height: 200px;
overflow: hidden;
flex-direction: column;