File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,16 @@ const pureInteractiveElements = Object.keys(DOMElements)
12
12
return interactiveElements ;
13
13
} , { } ) ;
14
14
15
+ const isLink = function isLink ( attributes ) {
16
+ const href = getPropValue ( getProp ( attributes , 'href' ) ) ;
17
+ const tabIndex = getTabIndex ( getProp ( attributes , 'tabIndex' ) ) ;
18
+ return href !== undefined || tabIndex !== undefined ;
19
+ } ;
20
+
15
21
export const interactiveElementsMap = {
16
22
...pureInteractiveElements ,
17
- a : ( attributes ) => {
18
- const href = getPropValue ( getProp ( attributes , 'href' ) ) ;
19
- const tabIndex = getTabIndex ( getProp ( attributes , 'tabIndex' ) ) ;
20
- return href !== undefined || tabIndex !== undefined ;
21
- } ,
22
- // This is same as `a` interactivity function
23
- area : ( attributes ) => {
24
- const href = getPropValue ( getProp ( attributes , 'href' ) ) ;
25
- const tabIndex = getTabIndex ( getProp ( attributes , 'tabIndex' ) ) ;
26
- return href !== undefined || tabIndex !== undefined ;
27
- } ,
23
+ a : isLink ,
24
+ area : isLink ,
28
25
input : ( attributes ) => {
29
26
const typeAttr = getLiteralPropValue ( getProp ( attributes , 'type' ) ) ;
30
27
return typeAttr ? typeAttr . toUpperCase ( ) !== 'HIDDEN' : true ;
You can’t perform that action at this time.
0 commit comments