File tree 3 files changed +10
-0
lines changed
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export interface Props {
7
7
name ?: string ;
8
8
id ?: string ;
9
9
type ?: string ;
10
+ title ?: string ;
10
11
defaultChecked ?: number | boolean ;
11
12
checked ?: number | boolean ;
12
13
disabled ?: boolean ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class Checkbox extends Component {
8
8
className : '' ,
9
9
style : { } ,
10
10
type : 'checkbox' ,
11
+ title : '' ,
11
12
defaultChecked : false ,
12
13
onFocus ( ) { } ,
13
14
onBlur ( ) { } ,
@@ -84,6 +85,7 @@ class Checkbox extends Component {
84
85
name,
85
86
id,
86
87
type,
88
+ title,
87
89
disabled,
88
90
readOnly,
89
91
tabIndex,
@@ -119,6 +121,7 @@ class Checkbox extends Component {
119
121
name = { name }
120
122
id = { id }
121
123
type = { type }
124
+ title = { title }
122
125
required = { required }
123
126
readOnly = { readOnly }
124
127
disabled = { disabled }
Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ describe('rc-checkbox', () => {
77
77
expect ( renderedInput . attributes . value . value ) . toEqual ( '6' ) ;
78
78
} ) ;
79
79
80
+ it ( 'passes title prop to input' , ( ) => {
81
+ const wrapper = mount ( < Checkbox title = "my-custom-title" /> ) ;
82
+ const renderedInput = wrapper . find ( 'input' ) . instance ( ) ;
83
+ expect ( renderedInput . attributes . title . value ) . toEqual ( 'my-custom-title' ) ;
84
+ } ) ;
85
+
80
86
it ( 'focus()' , ( ) => {
81
87
const container = document . createElement ( 'div' ) ;
82
88
document . body . appendChild ( container ) ;
You can’t perform that action at this time.
0 commit comments