File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ export default {
119
119
code : 'a11y-no-interactive-element-to-noninteractive-role' ,
120
120
message : `A11y: <${ element } > cannot have role '${ role } '`
121
121
} ) ,
122
+ a11y_no_noninteractive_element_to_interactive_role : ( role : string | boolean , element : string ) => ( {
123
+ code : 'a11y-no-noninteractive-element-to-interactive-role' ,
124
+ message : `A11y: Non-interactive element <${ element } > cannot have interactive role '${ role } '`
125
+ } ) ,
122
126
a11y_role_has_required_aria_props : ( role : string , props : string [ ] ) => ( {
123
127
code : 'a11y-role-has-required-aria-props' ,
124
128
message : `A11y: Elements with the ARIA role "${ role } " must have the following attributes defined: ${ props . map ( name => `"${ name } "` ) . join ( ', ' ) } `
Original file line number Diff line number Diff line change @@ -537,6 +537,11 @@ export default class Element extends Node {
537
537
if ( is_interactive_element ( this . name , attribute_map ) && ( is_non_interactive_roles ( current_role ) || is_presentation_role ( current_role ) ) ) {
538
538
component . warn ( this , compiler_warnings . a11y_no_interactive_element_to_noninteractive_role ( current_role , this . name ) ) ;
539
539
}
540
+
541
+ // no-noninteractive-element-to-interactive-role
542
+ if ( ! is_interactive_element ( this . name , attribute_map ) && is_interactive_roles ( current_role ) ) {
543
+ component . warn ( this , compiler_warnings . a11y_no_noninteractive_element_to_interactive_role ( current_role , this . name ) ) ;
544
+ }
540
545
} ) ;
541
546
542
547
}
You can’t perform that action at this time.
0 commit comments