Refactor Accessibility for RadioButton

pull/2798/head
Tuğçe Küçükoğlu 2022-07-21 14:14:23 +03:00
parent 6f7c92f708
commit 6f73a3350a
3 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<template>
<div :class="containerClass" @click="onClick($event)">
<div class="p-hidden-accessible">
<input ref="input" type="radio" :id="inputId" :checked="checked" :value="value" @focus="onFocus" @blur="onBlur" v-bind="inputProps">
<input ref="input" type="radio" :id="inputId" :name="name" :checked="checked" :disabled="disabled" :value="value" @focus="onFocus" @blur="onBlur" v-bind="inputProps">
</div>
<div ref="box" :class="['p-radiobutton-box', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]">
<div class="p-radiobutton-icon"></div>
@ -29,7 +29,11 @@ export default {
inputProps: {
type: Object,
default: null
}
},
name: {
type: String,
default: null
},
},
data() {
return {

View File

@ -52,7 +52,7 @@ export default {
}
},
created() {
this.selectedCategory = this.categories[1];
this.selectedCategory = this.categories[1].name;
},
components: {
'RadioButtonDoc': RadioButtonDoc

View File

@ -249,7 +249,7 @@ export default {
}
},
created() {
this.selectedCategory = this.categories[1];
this.selectedCategory = this.categories[1].name;
}
}
<\\/script>
@ -298,7 +298,7 @@ export default {
{name: 'Production', key: 'P'},
{name: 'Research', key: 'R'}
]);
const selectedCategory = ref(categories.value[1]);
const selectedCategory = ref(categories.value[1].name);
return { city, categories, selectedCategory }
}
@ -347,7 +347,7 @@ export default {
{name: 'Production', key: 'P'},
{name: 'Research', key: 'R'}
]);
const selectedCategory = ref(categories.value[1]);
const selectedCategory = ref(categories.value[1].name);
return { city, categories, selectedCategory }
},