summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components/annotations/annotation.form.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-05 16:16:00 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-05 16:16:00 +0200
commitbc1515b965e02641cab2a984410a3cb5cfae891c (patch)
treefbf30bf725b83a96574012616de9fd92057d7749 /animism-align/frontend/views/align/components/annotations/annotation.form.js
parentc74b743b5cb3be00611d24b58603dc2b52436e7c (diff)
more ui stuff
Diffstat (limited to 'animism-align/frontend/views/align/components/annotations/annotation.form.js')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotation.form.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/animism-align/frontend/views/align/components/annotations/annotation.form.js b/animism-align/frontend/views/align/components/annotations/annotation.form.js
index b62c36e..6972f93 100644
--- a/animism-align/frontend/views/align/components/annotations/annotation.form.js
+++ b/animism-align/frontend/views/align/components/annotations/annotation.form.js
@@ -22,6 +22,12 @@ class AnnotationForm extends Component {
this.handleSelect = this.handleSelect.bind(this)
this.handleKeyDown = this.handleKeyDown.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
+ this.textareaRef = React.createRef()
+ }
+ componentDidMount() {
+ if (this.textareaRef && this.textareaRef.current) {
+ this.textareaRef.current.focus()
+ }
}
handleKeyDown(e) {
if (e.keyCode === 27) { // escape
@@ -111,6 +117,7 @@ class AnnotationForm extends Component {
value={annotation.text}
onKeyDown={this.handleKeyDown}
onChange={this.handleChange}
+ ref={this.textareaRef}
/>
</div>
)