Commit 0122707 1 parent d2054f1 commit 0122707 Copy full SHA for 0122707
File tree 3 files changed +42
-2
lines changed
3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 123
123
border-color : $checkbox-hovered-border-color ;
124
124
background-color : $checkbox-hovered-bg-color ;
125
125
}
126
+ #{$checkbox-prefix } -label {
127
+ cursor : pointer ;
128
+ }
126
129
}
127
130
128
131
& .indeterminate :not (.disabled ):hover ,
Original file line number Diff line number Diff line change 22
22
width : $radio-width ;
23
23
height : $radio-width ;
24
24
margin : 0 ;
25
+ cursor : pointer ;
25
26
}
26
27
}
27
28
108
109
border-color : $radio-hovered-border-color ;
109
110
background-color : $radio-hovered-bg-color ;
110
111
}
112
+ #{$radio-prefix } -label {
113
+ cursor : pointer ;
114
+ }
111
115
}
112
116
113
117
& .checked :not (.disabled ):hover ,
274
278
top : 0 ;
275
279
left : 0 ;
276
280
margin : 0 ;
277
- cursor : pointer ;
278
281
}
279
282
}
280
283
& -group {
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import Enzyme from 'enzyme' ;
2
+ import Enzyme , { mount } from 'enzyme' ;
3
3
import Adapter from 'enzyme-adapter-react-16' ;
4
+ import assert from 'power-assert' ;
4
5
import Radio from '../../src/radio/index' ;
5
6
import '../../src/radio/style' ;
6
7
import { unmount , testReact } from '../util/a11y/validate' ;
@@ -98,4 +99,37 @@ describe('Radio A11y', () => {
98
99
) ;
99
100
return wrapper ;
100
101
} ) ;
102
+
103
+ it ( 'should add tabIndex for first Radio Item' , async ( ) => {
104
+ const wrapper = mount (
105
+ < Radio . Group >
106
+ < Radio id = "pear" value = "pear" checked > ={ true }
107
+ 梨子
108
+ </ Radio >
109
+ < Radio id = "apple" value = "apple" className = "apple" >
110
+ 苹果
111
+ </ Radio >
112
+ </ Radio . Group >
113
+ ) ;
114
+ wrapper . update ( ) ;
115
+ assert ( wrapper . find ( "input#pear" ) . at ( 0 ) . getDOMNode ( ) . tabIndex === 0 ) ;
116
+ } ) ;
117
+
118
+ it ( 'should not add tabIndex for non Radio Item' , async ( ) => {
119
+ const wrapper = mount (
120
+ < Radio . Group defaultValue = { 'pear' } >
121
+ < div id = "mywrapper" >
122
+ < Radio id = "pear" value = "pear" >
123
+ 梨子
124
+ </ Radio >
125
+ </ div >
126
+ < div id = 'another' tabIndex = "-100" >
127
+ < Radio id = "apple" value = "apple" className = "apple" >
128
+ 苹果
129
+ </ Radio >
130
+ </ div >
131
+ </ Radio . Group >
132
+ ) ;
133
+ assert ( wrapper . find ( "div#mywrapper" ) . at ( 0 ) . getDOMNode ( ) . tabIndex === - 1 ) ;
134
+ } ) ;
101
135
} ) ;
You can’t perform that action at this time.
0 commit comments