a11y: labels for checkboxes

Massimo Melina committed Jan 11, 2024 at 00:18 UTC 210c4eecf86dc9d17ba2064b3a57f0e262d5a402
4 files changed +19 -14
frontend/src/BrowseFiles.ts
+12 -11
@@ -210,17 +210,18 @@ const Entry = memo(({ entry, midnight, separator }: EntryProps) => {
210 props: { entry },
211 ifEmpty: () => h(Fragment, {},
212 showFilter && h(Checkbox, {
213 - disabled: isLink,
214 - 'aria-labelledby': ariaId,
215 - value: selected[uri],
216 - onChange(v) {
217 - if (v)
218 - return state.selected[uri] = true
219 - delete state.selected[uri]
220 - },
221 - }),
222 - h('span', { className: 'link-wrapper' }, // container to handle mouse over for both children
223 - ...isFolder || entry.web ? [ // internal navigation, use Link component
213 + 'aria-label': t`Select file`,
214 + disabled: isLink,
215 + 'aria-labelledby': ariaId,
216 + value: selected[uri],
217 + onChange(v){
218 + if (v)
219 + return state.selected[uri] = true
220 + delete state.selected[uri]
221 + },
222 + }),
223 + h('span', { className: 'link-wrapper' }, // container to handle mouse over for both children
224 + ...isFolder || entry.web ? [ // internal navigation, use Link component
225 h(Link, { to: uri, ...ariaProps }, ico, entry.n.slice(0, -1)), // don't use name, as we want to include whole path in case of search
226 // popup button is here to be able to detect link-wrapper:hover
227 file_menu_on_link && !showingButton && h('button', {
frontend/src/FilterBar.ts
+1 -1
@@ -23,7 +23,7 @@ export function FilterBar() {
23 value: all,
24 tabIndex,
25 'aria-hidden': !showFilter,
26 - 'aria-label': "Select all",
26 + 'aria-label': t`Select all`,
27 onContextMenu(ev) {
28 ev.preventDefault()
29 select(undefined)
src/langs/hfs-lang-en.json
+3 -1
@@ -151,6 +151,8 @@
151 "clipboard_list": "Items in clipboard:",
152
153 "Auto-play": "Auto-play",
154 - "autoplay_seconds": "Seconds to wait on images"
154 + "autoplay_seconds": "Seconds to wait on images",
155 + "Select file": "Select file",
156 + "Select all": "Select all"
157 }
158 }
src/langs/hfs-lang-it.json
+3 -1
@@ -143,6 +143,8 @@
143 "clipboard_list": "Elementi negli appunti",
144
145 "Auto-play": "Auto-play",
146 - "autoplay_seconds": "Secondi di attesa mostrando immagini"
146 + "autoplay_seconds": "Secondi di attesa mostrando immagini",
147 + "Select file": "Seleziona file",
148 + "Select all": "Seleziona tutto"
149 }
150 }