File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export interface Props {
77 name ?: string ;
88 id ?: string ;
99 type ?: string ;
10+ title ?: string ;
1011 defaultChecked ?: number | boolean ;
1112 checked ?: number | boolean ;
1213 disabled ?: boolean ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class Checkbox extends Component {
88 className : '' ,
99 style : { } ,
1010 type : 'checkbox' ,
11+ title : '' ,
1112 defaultChecked : false ,
1213 onFocus ( ) { } ,
1314 onBlur ( ) { } ,
@@ -84,6 +85,7 @@ class Checkbox extends Component {
8485 name,
8586 id,
8687 type,
88+ title,
8789 disabled,
8890 readOnly,
8991 tabIndex,
@@ -119,6 +121,7 @@ class Checkbox extends Component {
119121 name = { name }
120122 id = { id }
121123 type = { type }
124+ title = { title }
122125 required = { required }
123126 readOnly = { readOnly }
124127 disabled = { disabled }
Original file line number Diff line number Diff line change @@ -77,6 +77,12 @@ describe('rc-checkbox', () => {
7777 expect ( renderedInput . attributes . value . value ) . toEqual ( '6' ) ;
7878 } ) ;
7979
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+
8086 it ( 'focus()' , ( ) => {
8187 const container = document . createElement ( 'div' ) ;
8288 document . body . appendChild ( container ) ;
You can’t perform that action at this time.
0 commit comments