File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/react-bootstrap-table2/src Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11/* eslint no-return-assign: 0 */
22import React , { Component } from 'react' ;
3+ import PropTypes from 'prop-types' ;
34
45class TextEditor extends Component {
56 componentDidMount ( ) {
7+ const { defaultValue } = this . props ;
8+ this . text . value = defaultValue ;
69 this . text . focus ( ) ;
710 }
811
912 render ( ) {
13+ const { defaultValue, ...rest } = this . props ;
1014 return (
1115 < input
1216 ref = { node => this . text = node }
1317 type = "text"
1418 className = "form-control editor edit-text"
15- { ...this . props }
19+ { ...rest }
1620 />
1721 ) ;
1822 }
1923}
2024
25+ TextEditor . propTypes = {
26+ defaultValue : PropTypes . oneOfType ( [
27+ PropTypes . string ,
28+ PropTypes . number
29+ ] )
30+ } ;
2131export default TextEditor ;
You can’t perform that action at this time.
0 commit comments