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} {#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} {#each media as mediaItem, index}
<ComposeMediaItem {realm} {mediaItem} {index} {media} /> <ComposeMediaItem {realm} {mediaItem} {index} {media} />
{/each} {/each}
</div> </ul>
{/if} {/if}
<style> <style>
.compose-media-container { .compose-media-container {
grid-area: media; grid-area: media;
list-style: none;
display: grid; display: grid;
grid-column-gap: 5px; grid-column-gap: 5px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 10px; margin: 10px 0 0 0;
background: var(--form-bg); background: var(--form-bg);
padding: 5px; padding: 5px;
border-radius: 4px; 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} /> <img src={mediaItem.data.preview_url} {alt} />
<div class="compose-media-delete"> <div class="compose-media-delete">
<button class="compose-media-delete-button" <button class="compose-media-delete-button"
@ -18,9 +18,11 @@
Describe {shortName} for the visually impaired Describe {shortName} for the visually impaired
</label> </label>
</div> </div>
</div> </li>
<style> <style>
.compose-media { .compose-media {
margin: 0;
padding: 0;
height: 200px; height: 200px;
overflow: hidden; overflow: hidden;
flex-direction: column; flex-direction: column;