Skip to content

Commit 0af348f

Browse files
authored
Merge pull request #3813 from nextcloud/bugfix/noid/rename-accessibility
Make rename functions accessibly by keyboard navigation
2 parents 0443ca3 + b3f252e commit 0af348f

3 files changed

Lines changed: 51 additions & 19 deletions

File tree

src/components/board/Board.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export default {
222222
padding: $stack-spacing;
223223
overflow-x: hidden;
224224
overflow-y: auto;
225+
scrollbar-gutter: stable;
225226
padding-top: 15px;
226227
margin-top: -10px;
227228
}

src/components/board/Stack.vue

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,22 @@
2323

2424
<template>
2525
<div class="stack">
26-
<div v-click-outside="stopCardCreation" class="stack__header" :class="{'stack__header--add': showAddCard }">
26+
<div v-click-outside="stopCardCreation"
27+
class="stack__header"
28+
:class="{'stack__header--add': showAddCard }"
29+
tabindex="0"
30+
:aria-label="stack.title">
2731
<transition name="fade" mode="out-in">
2832
<h3 v-if="!canManage || isArchived">
2933
{{ stack.title }}
3034
</h3>
3135
<h3 v-else-if="!editing"
3236
v-tooltip="stack.title"
37+
tabindex="0"
38+
:aria-label="stack.title"
3339
class="stack__title"
34-
@click="startEditing(stack)">
40+
@click="startEditing(stack)"
41+
@keydown.enter="startEditing(stack)">
3542
{{ stack.title }}
3643
</h3>
3744
<form v-else @submit.prevent="finishedEdit(stack)">
@@ -328,36 +335,47 @@ export default {
328335
flex-grow: 1;
329336
display: flex;
330337
cursor: inherit;
338+
margin: 0;
331339
332340
input[type=text] {
333341
flex-grow: 1;
334342
}
335343
}
336-
}
337344
338-
.stack__title {
339-
white-space: nowrap;
340-
overflow: hidden;
341-
text-overflow: ellipsis;
342-
max-width: calc($stack-width - 60px);
345+
h3.stack__title {
346+
white-space: nowrap;
347+
overflow: hidden;
348+
text-overflow: ellipsis;
349+
max-width: calc($stack-width - 60px);
350+
border-radius: 3px;
351+
margin: 6px;
352+
padding: 4px 4px;
353+
354+
&:focus {
355+
outline: 2px solid var(--color-border-dark);
356+
border-radius: 3px;
357+
}
358+
}
359+
360+
form {
361+
margin: 2px 0;
362+
}
343363
}
344364
345365
.stack__card-add {
346-
width: $stack-width;
347366
height: 44px;
348367
flex-shrink: 0;
349368
z-index: 100;
350369
display: flex;
351-
margin-left: 12px;
352-
margin-right: 12px;
353370
margin-top: 5px;
354371
margin-bottom: 20px;
355372
background-color: var(--color-main-background);
356373
357374
form {
358375
display: flex;
376+
margin-left: 12px;
377+
margin-right: 12px;
359378
width: 100%;
360-
margin: 0;
361379
box-shadow: 0 0 3px var(--color-box-shadow);
362380
border-radius: var(--border-radius-large);
363381
overflow: hidden;

src/components/cards/CardItem.vue

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@
3535
{{ board.title }} » {{ stack.title }}
3636
</div>
3737
<div class="card-upper">
38-
<h3 v-if="compactMode || isArchived || showArchived || !canEdit || standalone">
38+
<h3 v-if="inlineEditingBlocked">
3939
{{ card.title }}
4040
</h3>
41-
<h3 v-else-if="!editing">
42-
<span @click.stop="startEditing(card)">{{ card.title }}</span>
41+
<h3 v-else-if="!editing"
42+
tabindex="0"
43+
class="editable"
44+
:aria-label="t('deck', 'Edit card title')"
45+
@click.stop="startEditing(card)"
46+
@keydown.enter.stop.prevent="startEditing(card)">
47+
{{ card.title }}
4348
</h3>
44-
45-
<form v-if="editing"
49+
<form v-else-if="editing"
4650
v-click-outside="cancelEdit"
4751
class="dragDisabled"
4852
@click.stop
@@ -139,6 +143,9 @@ export default {
139143
const board = this.$store.getters.boards.find((item) => item.id === this.card.boardId)
140144
return board ? !board.archived && board.permissions.PERMISSION_EDIT : false
141145
},
146+
inlineEditingBlocked() {
147+
return this.compactMode || this.isArchived || this.showArchived || !this.canEdit || this.standalone
148+
},
142149
card() {
143150
return this.item ? this.item : this.$store.getters.cardById(this.id)
144151
},
@@ -227,14 +234,20 @@ export default {
227234
228235
}
229236
h3 {
230-
margin: 12px $card-padding;
237+
margin: 5px $card-padding;
238+
padding: 6px;
231239
flex-grow: 1;
232240
font-size: 100%;
233241
overflow: hidden;
234242
word-wrap: break-word;
235243
padding-left: 4px;
236-
span {
244+
&.editable {
237245
cursor: text;
246+
247+
&:focus {
248+
outline: 2px solid var(--color-border-dark);
249+
border-radius: 3px;
250+
}
238251
}
239252
}
240253
input[type=text] {

0 commit comments

Comments
 (0)