Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8082856

Browse files
committed
fix focus on the Last Character in Text Input
1 parent 692b0a2 commit 8082856

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎packages/react-bootstrap-table2/src/text-editor.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ import React, { Component } from 'react';
33

44
class TextEditor extends Component {
55
componentDidMount() {
6+
const { defaultValue } = this.props;
7+
this.text.value = defaultValue;
68
this.text.focus();
79
}
810

911
render() {
12+
const {
13+
onKeyDown,
14+
onBlur
15+
} = this.props;
1016
return (
1117
<input
1218
ref={ node => this.text = node }
1319
type="text"
1420
className="form-control editor edit-text"
15-
{ ...this.props }
21+
onKeyDown={onKeyDown}
22+
onBlur={onBlur}
1623
/>
1724
);
1825
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /