@@ -52,7 +52,11 @@ class RadioCollection extends CollectionWidget<Properties> {
5252 _getIdTarget ( $target : dxElementWrapper ) : dxElementWrapper {
5353 const $radioContainer = $target . find ( `.${ RADIO_VALUE_CONTAINER_CLASS } ` ) ;
5454
55- return $radioContainer ;
55+ if ( $radioContainer . length ) {
56+ return $radioContainer ;
57+ }
58+
59+ return $target ;
5660 }
5761
5862 _postprocessRenderItem ( args ) : void {
@@ -62,24 +66,31 @@ class RadioCollection extends CollectionWidget<Properties> {
6266 const $itemElement = $ ( itemElement ) ;
6367 const contentId = `dx-${ new Guid ( ) } ` ;
6468
69+ let $radioContainer = $itemElement . find ( `.${ RADIO_VALUE_CONTAINER_CLASS } ` ) ;
70+
6571 if ( ! html ) {
6672 const $radio = $ ( '<div>' ) . addClass ( RADIO_BUTTON_ICON_CLASS ) ;
6773
6874 $ ( '<div>' ) . addClass ( RADIO_BUTTON_ICON_DOT_CLASS ) . appendTo ( $radio ) ;
6975
70- const $radioContainer = $ ( '<div>' ) . append ( $radio ) . addClass ( RADIO_VALUE_CONTAINER_CLASS ) ;
71-
76+ $radioContainer = $ ( '<div>' ) . append ( $radio ) . addClass ( RADIO_VALUE_CONTAINER_CLASS ) ;
7277 $itemElement . prepend ( $radioContainer ) ;
78+ }
7379
74- const aria = {
75- role : 'radio' ,
76- // eslint-disable-next-line spellcheck/spell-checker
77- labelledby : contentId ,
78- } ;
80+ // eslint-disable-next-line spellcheck/spell-checker
81+ const aria : { role : string ; labelledby ?: string } = {
82+ role : 'radio' ,
83+ } ;
7984
80- this . setAria ( aria , $radioContainer ) ;
85+ if ( ! html ) {
86+ // eslint-disable-next-line spellcheck/spell-checker
87+ aria . labelledby = contentId ;
8188 }
8289
90+ const $ariaTarget = $radioContainer . length ? $radioContainer : $itemElement ;
91+
92+ this . setAria ( aria , $ariaTarget ) ;
93+
8394 super . _postprocessRenderItem ( args ) ;
8495
8596 if ( ! html ) {
@@ -103,8 +114,9 @@ class RadioCollection extends CollectionWidget<Properties> {
103114 . toggleClass ( RADIO_BUTTON_ICON_CHECKED_CLASS , isSelected ) ;
104115
105116 const $radioContainer = $itemElement . find ( `.${ RADIO_VALUE_CONTAINER_CLASS } ` ) ;
117+ const $ariaCheckedTarget = $radioContainer . length ? $radioContainer : $itemElement ;
106118
107- this . setAria ( 'checked' , isSelected , $radioContainer ) ;
119+ this . setAria ( 'checked' , isSelected , $ariaCheckedTarget ) ;
108120 }
109121
110122 _refreshContent ( ) : void {
0 commit comments