33import hasAttribute from './hasAttribute' ;
44import getAttributeValue from './getAttributeValue' ;
55
6+ const DOMElements = [
7+ "a" , "abbr" , "address" , "area" , "article" ,
8+ "aside" , "audio" , "b" , "base" , "bdi" , "bdo" , "big" ,
9+ "blockquote" , "body" , "br" , "button" , "canvas" , "caption" ,
10+ "cite" , "code" , "col" , "colgroup" , "data" , "datalist" ,
11+ "dd" , "del" , "details" , "dfn" , "dialog" , "div" , "dl" , "dt" ,
12+ "em" , "embed" , "fieldset" , "figcaption" , "figure" , "footer" ,
13+ "form" , "h1" , "h2" , "h3" , "h4" , "h5" , "h6" , "head" , "header" ,
14+ "hgroup" , "hr" , "html" , "i" , "iframe" , "img" , "input" , "ins" ,
15+ "kbd" , "keygen" , "label" , "legend" , "li" , "link" , "main" , "map" ,
16+ "mark" , "menu" , "menuitem" , "meta" , "meter" , "nav" , "noscript" ,
17+ "object" , "ol" , "optgroup" , "option" , "output" , "p" , "param" ,
18+ "picture" , "pre" , "progress" , "q" , "rp" , "rt" , "ruby" , "s" ,
19+ "samp" , "script" , "section" , "select" , "small" , "source" , "span" ,
20+ "strong" , "style" , "sub" , "summary" , "sup" , "table" , "tbody" ,
21+ "td" , "textarea" , "tfoot" , "th" , "thead" , "time" , "title" , "tr" ,
22+ "track" , "u" , "ul" , "var" , "video" , "wbr"
23+ ] ;
24+
625const interactiveMap = {
726 a : attributes => {
827 const hasHref = hasAttribute ( attributes , 'href' ) ;
@@ -26,6 +45,12 @@ const interactiveMap = {
2645 * it's intention is to be interacted with on the DOM.
2746 */
2847const isInteractiveElement = ( tagName , attributes ) => {
48+ // Do not test higher level JSX components, as we do not know what
49+ // low-level DOM element this maps to.
50+ if ( DOMElements . indexOf ( tagName ) === - 1 ) {
51+ return true ;
52+ }
53+
2954 if ( interactiveMap . hasOwnProperty ( tagName ) === false ) {
3055 return false ;
3156 }
0 commit comments