diff --git a/docs/cell-edit.md b/docs/cell-edit.md
index 8502c8c..6c46151 100644
--- a/docs/cell-edit.md
+++ b/docs/cell-edit.md
@@ -10,6 +10,7 @@ $ npm install react-bootstrap-table2-editor --save
* [blurToSave](#blurToSave)
* [nonEditableRows](#nonEditableRows)
* [timeToCloseMessage](#timeToCloseMessage)
+* [autoSelectText](#autoSelectText)
* [beforeSaveCell](#beforeSaveCell)
* [afterSaveCell](#afterSaveCell)
* [errorMessage](#errorMessage)
@@ -43,6 +44,11 @@ Default is `false`, enable it will be able to save the cell automatically when b
### cellEdit.nonEditableRows - [Function]
`cellEdit.nonEditableRows` accept a callback function and expect return an array which used to restrict all the columns of some rows as non-editable. So the each item in return array should be rowkey(`keyField`)
+### cellEdit.autoSelectText - [Bool]
+Default is false, when enable it, `react-bootstrap-table2` will help you to select the text in the text input automatically when editing.
+
+> NOTE: This props only work for `text` and `textarea`.
+
### cellEdit.timeToCloseMessage - [Function]
If a [`column.validator`](./columns.md#validator) defined and the new value is invalid, `react-bootstrap-table2` will popup a alert at the bottom of editor. `cellEdit.timeToCloseMessage` is a chance to let you decide how long the alert should be stay. Default is 3000 millisecond.
diff --git a/packages/react-bootstrap-table2-editor/src/editing-cell.js b/packages/react-bootstrap-table2-editor/src/editing-cell.js
index 463c8c5..39aa9a5 100644
--- a/packages/react-bootstrap-table2-editor/src/editing-cell.js
+++ b/packages/react-bootstrap-table2-editor/src/editing-cell.js
@@ -24,6 +24,7 @@ export default (_, onStartEdit) =>
onUpdate: PropTypes.func.isRequired,
onEscape: PropTypes.func.isRequired,
timeToCloseMessage: PropTypes.number,
+ autoSelectText: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object
}
@@ -31,6 +32,7 @@ export default (_, onStartEdit) =>
static defaultProps = {
timeToCloseMessage: TIME_TO_CLOSE_MESSAGE,
className: null,
+ autoSelectText: false,
style: {}
}
@@ -121,7 +123,7 @@ export default (_, onStartEdit) =>
render() {
let editor;
- const { row, column, className, style, rowIndex, columnIndex } = this.props;
+ const { row, column, className, style, rowIndex, columnIndex, autoSelectText } = this.props;
const { dataField } = column;
const value = _.get(row, dataField);
@@ -174,13 +176,13 @@ export default (_, onStartEdit) =>
} else if (isDefaultEditorDefined && column.editor.type === EDITTYPE.SELECT) {
editor =
{ sourceCode }
+