Skip to content

Commit b060efa

Browse files
committed
fix(settings): hide list of webauthn devices if empty
- resolves #59339 If there are no devices the list would be empty. This is invalid for accessibility, as every list needs at least one listitem. Ref: https://www.w3.org/TR/wai-aria-1.2/#mustContain Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 13583e8 commit b060efa

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

apps/settings/src/components/WebAuthn/WebAuthnSection.vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@
99
<p class="settings-hint hidden-when-empty">
1010
{{ t('settings', 'Set up your account for passwordless authentication following the FIDO2 standard.') }}
1111
</p>
12+
1213
<NcNoteCard v-if="devices.length === 0" type="info">
1314
{{ t('settings', 'No devices configured.') }}
1415
</NcNoteCard>
15-
16-
<h3 v-else id="security-webauthn__active-devices">
17-
{{ t('settings', 'The following devices are configured for your account:') }}
18-
</h3>
19-
<ul aria-labelledby="security-webauthn__active-devices" class="security-webauthn__device-list">
20-
<WebAuthnDevice
21-
v-for="device in sortedDevices"
22-
:key="device.id"
23-
:name="device.name"
24-
@delete="deleteDevice(device.id)" />
25-
</ul>
16+
<template v-else>
17+
<h3 id="security-webauthn__active-devices">
18+
{{ t('settings', 'The following devices are configured for your account:') }}
19+
</h3>
20+
<ul aria-labelledby="security-webauthn__active-devices" class="security-webauthn__device-list">
21+
<WebAuthnDevice
22+
v-for="device in sortedDevices"
23+
:key="device.id"
24+
:name="device.name"
25+
@delete="deleteDevice(device.id)" />
26+
</ul>
27+
</template>
2628

2729
<NcNoteCard v-if="!supportsWebauthn" type="warning">
2830
{{ t('settings', 'Your browser does not support WebAuthn.') }}

0 commit comments

Comments
 (0)