Skip to content

Commit f27eb77

Browse files
authored
fix: dropzone focus state and add-more-files button semantics (#32)
* fix: add focus state to dropzone remove button and make add-more-files a button (#23) - Add :focus-visible outline to the remove button in UploadedFileTemplate for keyboard visibility - Pass onclick to the Chip component in FileInput so it renders as a <button> element, fixing keyboard accessibility and semantics for the "add more files" control * fix: remove hardcoded container names to allow multiple worktrees to run simultaneously * fix: prevent focus outlines from being clipped or hidden - Add focus-visible outline + z-index to remove button in dropzone - Override Dropzone's default white background on file previews - Use overflow:clip with clip-margin on dz-previews and help-section so focus outlines aren't cut off by scroll containers - Add z-index to HelpToggle focus state so outline paints above sibling recipient cards - Restore primary-btn focus-visible outline on 1dppx screens (was incorrectly set to outline:none)
1 parent 062cdc3 commit f27eb77

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/lib/components/HelpToggle.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
width: 100%;
3131
box-sizing: border-box;
3232
min-width: 0;
33-
overflow: hidden;
33+
overflow: clip;
34+
overflow-clip-margin: 4px;
3435
}
3536
3637
.help-section.bordered {
@@ -56,6 +57,8 @@
5657
outline: 2px solid var(--pg-primary);
5758
outline-offset: 2px;
5859
border-radius: var(--pg-border-radius-sm);
60+
position: relative;
61+
z-index: 1;
5962
}
6063
6164
.help-section.bordered .help-toggle {

src/lib/components/filesharing/inputs/FileInput.svelte

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
icon="+"
136136
size="lg"
137137
variant="default"
138+
onclick={() => {}}
138139
/>
139140
</div>
140141
{/if}
@@ -343,7 +344,10 @@
343344
gap: 0.5rem;
344345
max-height: 300px;
345346
overflow-y: auto;
347+
overflow-x: clip;
348+
overflow-clip-margin: 4px;
346349
pointer-events: auto;
350+
padding-right: 4px;
347351
}
348352
349353
.dz-previews.encrypting :global(.remove-button) {
@@ -356,6 +360,7 @@
356360
margin: 0;
357361
min-height: 0;
358362
position: relative;
363+
background: transparent;
359364
}
360365
361366
/* Preview template styles (injected by Dropzone, so must be :global) */
@@ -416,7 +421,7 @@
416421
.dz-previews :global(.remove-button) {
417422
cursor: pointer;
418423
height: 100%;
419-
padding: 4px 0 4px 4px;
424+
padding: 4px 4px 4px 4px;
420425
border-radius: var(--pg-border-radius-md);
421426
transition: all 0.2s ease;
422427
display: flex;
@@ -429,6 +434,12 @@
429434
background-color: var(--pg-soft-background);
430435
}
431436
437+
.dz-previews :global(.remove-button:focus-visible) {
438+
outline: 2px solid var(--pg-primary);
439+
outline-offset: 2px;
440+
z-index: 1;
441+
}
442+
432443
.dz-previews :global(.remove-button *) {
433444
cursor: pointer;
434445
}

src/lib/components/filesharing/inputs/UploadedFileTemplate.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999
background-color: var(--pg-soft-background);
100100
}
101101
102+
.remove-button:focus-visible {
103+
outline: 2px solid var(--pg-primary);
104+
outline-offset: 2px;
105+
}
106+
102107
.remove-button * {
103108
cursor: pointer;
104109
}

src/lib/global.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ h3 {
594594
}
595595

596596
.primary-btn:focus-visible {
597-
outline: none;
597+
outline: 2px solid var(--pg-primary);
598+
outline-offset: 2px;
598599
}
599600

600601
.crypt-btn:hover:not(:disabled):not([disabled]):not(.crypt-btn-disabled) {

0 commit comments

Comments
 (0)