Skip to content

Commit

Permalink
Merge pull request #4448 from nextcloud-libraries/enh/a11y/text-edita…
Browse files Browse the repository at this point in the history
…ble-label

Add accessible label to textarea
  • Loading branch information
raimund-schluessler committed Aug 23, 2023
2 parents ad61a14 + 283782b commit daed212
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/NcActionTextEditable/NcActionTextEditable.vue
Expand Up @@ -76,11 +76,14 @@ export default {
<input :id="id" type="submit" class="action-text-editable__submit">

<!-- name -->
<strong v-if="name" class="action-text__name">
<label v-if="name"
class="action-text-editable__name"
:for="computedId">
{{ name }}
</strong>
</label>

<textarea :disabled="disabled"
<textarea :id="computedId"
:disabled="disabled"
:value="value"
v-bind="$attrs"
:class="['action-text-editable__textarea', { focusable: isFocusable }]"
Expand Down Expand Up @@ -151,6 +154,10 @@ export default {
isFocusable() {
return !this.disabled
},
computedId() {
return GenRandomId()
},
},
methods: {
Expand Down Expand Up @@ -347,5 +354,4 @@ li:last-child > .action-text-editable {
li:first-child > .action-text-editable {
margin-top: $icon-margin - $input-margin;
}
</style>

0 comments on commit daed212

Please sign in to comment.