Skip to content

Commit f357ef9

Browse files
committed
supercedes #462: resizable commit message input box
1 parent a656567 commit f357ef9

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"nbdime": "~5.0.1",
6161
"react": "~16.8.4",
6262
"react-dom": "~16.8.4",
63+
"react-textarea-autosize": "^7.1.2",
6364
"typestyle": "^2.0.1"
6465
},
6566
"devDependencies": {
@@ -71,6 +72,7 @@
7172
"@types/jest": "^24",
7273
"@types/react": "~16.8.13",
7374
"@types/react-dom": "~16.0.5",
75+
"@types/react-textarea-autosize": "^4.3.5",
7476
"enzyme": "3.7.0",
7577
"enzyme-adapter-react-16": "1.7.0",
7678
"husky": "1.3.1",

src/components/CommitBox.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as React from 'react';
2+
import TextareaAutosize from 'react-textarea-autosize';
23
import { classes } from 'typestyle';
4+
35
import {
46
stagedCommitButtonDisabledStyle,
57
stagedCommitButtonReadyStyle,
@@ -73,7 +75,7 @@ export class CommitBox extends React.Component<
7375
className={stagedCommitStyle}
7476
onKeyPress={event => this.onKeyPress(event)}
7577
>
76-
<textarea
78+
<TextareaAutosize
7779
className={classes(textInputStyle, stagedCommitMessageStyle)}
7880
disabled={!this.props.hasFiles}
7981
placeholder={

yarn.lock

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,6 +1769,13 @@
17691769
dependencies:
17701770
"@types/react" "*"
17711771

1772+
"@types/react-textarea-autosize@^4.3.5":
1773+
version "4.3.5"
1774+
resolved "https://registry.yarnpkg.com/@types/react-textarea-autosize/-/react-textarea-autosize-4.3.5.tgz#6c4d2753fa1864c98c0b2b517f67bb1f6e4c46de"
1775+
integrity sha512-PiDL83kPMTolyZAWW3lyzO6ktooTb9tFTntVy7CA83/qFLWKLJ5bLeRboy6J6j3b1e8h2Eec6gBTEOOJRjV14A==
1776+
dependencies:
1777+
"@types/react" "*"
1778+
17721779
"@types/react@*", "@types/react@~16.8.13", "@types/react@~16.8.18", "@types/react@~16.8.4":
17731780
version "16.8.23"
17741781
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.23.tgz#ec6be3ceed6353a20948169b6cb4c97b65b97ad2"
@@ -5344,7 +5351,7 @@ prop-types-exact@^1.2.0:
53445351
object.assign "^4.1.0"
53455352
reflect.ownkeys "^0.2.0"
53465353

5347-
prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
5354+
prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
53485355
version "15.7.2"
53495356
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
53505357
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -5487,6 +5494,14 @@ react-test-renderer@^16.0.0-0:
54875494
react-is "^16.8.6"
54885495
scheduler "^0.13.6"
54895496

5497+
react-textarea-autosize@^7.1.2:
5498+
version "7.1.2"
5499+
resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-7.1.2.tgz#70fdb333ef86bcca72717e25e623e90c336e2cda"
5500+
integrity sha512-uH3ORCsCa3C6LHxExExhF4jHoXYCQwE5oECmrRsunlspaDAbS4mGKNlWZqjLfInWtFQcf0o1n1jC/NGXFdUBCg==
5501+
dependencies:
5502+
"@babel/runtime" "^7.1.2"
5503+
prop-types "^15.6.0"
5504+
54905505
react-transition-group@^2.9.0:
54915506
version "2.9.0"
54925507
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d"

0 commit comments

Comments
 (0)