diff --git a/src/components/radiobutton/RadioButton.vue b/src/components/radiobutton/RadioButton.vue index 00a6d6060..2a3ff17f0 100755 --- a/src/components/radiobutton/RadioButton.vue +++ b/src/components/radiobutton/RadioButton.vue @@ -3,7 +3,7 @@
-
+
@@ -51,7 +51,12 @@ export default { return this.modelValue != null && ObjectUtils.equals(this.modelValue, this.value); }, containerClass() { - return ['p-radiobutton p-component', this.class, {'p-radiobutton-checked': this.checked, 'p-radiobutton-disabled': this.$attrs.disabled, 'p-radiobutton-focused': this.focused}]; + return [ + 'p-radiobutton p-component', this.class, { + 'p-radiobutton-checked': this.checked, + 'p-radiobutton-disabled': this.$attrs.disabled, + 'p-radiobutton-focused': this.focused + }]; } } } diff --git a/src/views/radiobutton/RadioButtonDemo.vue b/src/views/radiobutton/RadioButtonDemo.vue index d39f1c72a..c0234f47f 100755 --- a/src/views/radiobutton/RadioButtonDemo.vue +++ b/src/views/radiobutton/RadioButtonDemo.vue @@ -30,7 +30,7 @@
Dynamic Values, Preselection, Value Binding and Disabled Option
- +
diff --git a/src/views/radiobutton/RadioButtonDoc.vue b/src/views/radiobutton/RadioButtonDoc.vue index 55718b1c1..0d0ddefae 100755 --- a/src/views/radiobutton/RadioButtonDoc.vue +++ b/src/views/radiobutton/RadioButtonDoc.vue @@ -131,15 +131,68 @@ export default { p-radiobutton-icon Icon element. - - - p-radiobutton-label - Label element. +
Accessibility
+ +
Screen Reader
+

RadioButton component uses a hidden native radio button element internally that is only visible to screen readers. Value to describe the component can either be provided via label tag combined with id prop or using aria-labelledby, aria-label props.

+ +

+<label for="rb1">One</label>
+<RadioButton id="rb1" />
+
+<span id="rb2">Two</span>
+<RadioButton aria-labelledby="rb2" />
+
+<RadioButton aria-label="Three" />
+
+
+ +
Keyboard Support
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
KeyFunction
tabMoves focus to the checked radio button, if there is none within the group then first radio button receives the focus.
+ + left arrow + up arrow + + Moves focus to the previous radio button, if there is none then last radio button receives the focus.
+ + right arrow + down arrow + + Moves focus to the next radio button, if there is none then first radio button receives the focus.
spaceIf the focused radio button is unchecked, changes the state to checked.
+
+
+
Dependencies

None.

@@ -175,7 +228,7 @@ export default {
Dynamic Values, Preselection, Value Binding and Disabled Option
- +
@@ -227,7 +280,7 @@ export default {
Dynamic Values, Preselection, Value Binding and Disabled Option
- +
@@ -277,7 +330,7 @@ export default {
Dynamic Values, Preselection, Value Binding and Disabled Option
- +