feat: add aria-label for forms
This commit is contained in:
parent
ece4466b7a
commit
0daf02393b
|
|
@ -34,10 +34,12 @@
|
||||||
<span class="mod-options">
|
<span class="mod-options">
|
||||||
<i
|
<i
|
||||||
v-if="showRemove"
|
v-if="showRemove"
|
||||||
|
tabindex="0"
|
||||||
role="button"
|
role="button"
|
||||||
aria-label="Delete comment"
|
aria-label="Delete comment"
|
||||||
class="ion-trash-a"
|
class="ion-trash-a"
|
||||||
@click="emit('remove-comment')"
|
@click="emit('remove-comment')"
|
||||||
|
@keypress.enter="emit('remove-comment')"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -45,19 +47,18 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
|
||||||
import type { Comment } from 'src/services/api'
|
import type { Comment } from 'src/services/api'
|
||||||
|
import { computed } from 'vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
comment: Comment
|
comment: Comment
|
||||||
username?: string
|
username?: string
|
||||||
}
|
}
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'remove-comment'): boolean
|
(e: 'remove-comment'): boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>()
|
|
||||||
const emit = defineEmits<Emits>()
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
const showRemove = computed(() => props.username !== undefined && props.username === props.comment.author.username)
|
const showRemove = computed(() => props.username !== undefined && props.username === props.comment.author.username)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.title"
|
v-model="form.title"
|
||||||
|
aria-label="Title"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
placeholder="Article Title"
|
placeholder="Article Title"
|
||||||
|
|
@ -15,6 +16,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.description"
|
v-model="form.description"
|
||||||
|
aria-label="Description"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
placeholder="What's this article about?"
|
placeholder="What's this article about?"
|
||||||
|
|
@ -23,6 +25,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<textarea
|
<textarea
|
||||||
v-model="form.body"
|
v-model="form.body"
|
||||||
|
aria-label="Body"
|
||||||
:rows="8"
|
:rows="8"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Write your article (in markdown)"
|
placeholder="Write your article (in markdown)"
|
||||||
|
|
@ -31,6 +34,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="newTag"
|
v-model="newTag"
|
||||||
|
aria-label="Tags"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Enter tags"
|
placeholder="Enter tags"
|
||||||
|
|
@ -44,10 +48,12 @@
|
||||||
class="tag-default tag-pill"
|
class="tag-default tag-pill"
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
class="ion-close-round"
|
|
||||||
role="button"
|
role="button"
|
||||||
:aria-label="`Remove tag: ${tag}`"
|
tabindex="0"
|
||||||
|
:aria-label="`Delete tag ${tag}`"
|
||||||
|
class="ion-close-round"
|
||||||
@click="removeTag(tag)"
|
@click="removeTag(tag)"
|
||||||
|
@keypress.enter="removeTag(tag)"
|
||||||
/>
|
/>
|
||||||
{{ tag }}
|
{{ tag }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
v-model="form.email"
|
v-model="form.email"
|
||||||
|
aria-label="Email"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
type="email"
|
type="email"
|
||||||
required
|
required
|
||||||
|
|
@ -41,6 +42,7 @@
|
||||||
<fieldset class=" form-group">
|
<fieldset class=" form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
|
aria-label="Password"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
type="password"
|
type="password"
|
||||||
required
|
required
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.username"
|
v-model="form.username"
|
||||||
|
aria-label="Username"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
type="text"
|
type="text"
|
||||||
required
|
required
|
||||||
|
|
@ -38,6 +39,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.email"
|
v-model="form.email"
|
||||||
|
aria-label="Email"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
type="email"
|
type="email"
|
||||||
required
|
required
|
||||||
|
|
@ -47,6 +49,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
|
aria-label="Password"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
type="password"
|
type="password"
|
||||||
:minLength="8"
|
:minLength="8"
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.image"
|
v-model="form.image"
|
||||||
|
aria-label="Avatar picture url"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="URL of profile picture"
|
placeholder="URL of profile picture"
|
||||||
|
|
@ -26,6 +27,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.username"
|
v-model="form.username"
|
||||||
|
aria-label="Username"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
placeholder="Your name"
|
placeholder="Your name"
|
||||||
|
|
@ -34,6 +36,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<textarea
|
<textarea
|
||||||
v-model="form.bio"
|
v-model="form.bio"
|
||||||
|
aria-label="Bio"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
:rows="8"
|
:rows="8"
|
||||||
placeholder="Short bio about you"
|
placeholder="Short bio about you"
|
||||||
|
|
@ -42,6 +45,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.email"
|
v-model="form.email"
|
||||||
|
aria-label="Email"
|
||||||
type="email"
|
type="email"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
placeholder="Email"
|
placeholder="Email"
|
||||||
|
|
@ -50,6 +54,7 @@
|
||||||
<fieldset class="form-group">
|
<fieldset class="form-group">
|
||||||
<input
|
<input
|
||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
|
aria-label="Password"
|
||||||
type="password"
|
type="password"
|
||||||
class="form-control form-control-lg"
|
class="form-control form-control-lg"
|
||||||
placeholder="New password"
|
placeholder="New password"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue