ref(chat): bring in package for text area auto-resizing

This commit is contained in:
Leonard Kim 2019-05-07 15:29:22 -07:00 committed by virtuacoplenny
parent f1546008f9
commit 09f881c0f5
3 changed files with 27 additions and 33 deletions

52
package-lock.json generated
View File

@ -2840,7 +2840,7 @@
"blueimp-md5": "^2.10.0", "blueimp-md5": "^2.10.0",
"json3": "^3.3.2", "json3": "^3.3.2",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"ua-parser-js": "github:amplitude/ua-parser-js#ed538f1" "ua-parser-js": "github:amplitude/ua-parser-js#ed538f16f5c6ecd8357da989b617d4f156dcf35d"
}, },
"dependencies": { "dependencies": {
"ua-parser-js": { "ua-parser-js": {
@ -6750,8 +6750,7 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -6769,13 +6768,11 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -6788,18 +6785,15 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -6902,8 +6896,7 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -6913,7 +6906,6 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -6926,20 +6918,17 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -6956,7 +6945,6 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -7029,8 +7017,7 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -7040,7 +7027,6 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -7116,8 +7102,7 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "bundled": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -7147,7 +7132,6 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -7165,7 +7149,6 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -7204,13 +7187,11 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "bundled": true
"optional": true
} }
} }
}, },
@ -12398,6 +12379,15 @@
"exenv": "^1.2.2" "exenv": "^1.2.2"
} }
}, },
"react-textarea-autosize": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-7.1.0.tgz",
"integrity": "sha512-c2FlR/fP0qbxmlrW96SdrbgP/v0XZMTupqB90zybvmDVDutytUgPl7beU35klwcTeMepUIQEpQUn3P3bdshGPg==",
"requires": {
"@babel/runtime": "^7.1.2",
"prop-types": "^15.6.0"
}
},
"react-transform-hmr": { "react-transform-hmr": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz", "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz",

View File

@ -79,6 +79,7 @@
"react-native-webrtc": "github:jitsi/react-native-webrtc#4064c6f2db4f8b961daaaa8dafc6a896d7cfbc43", "react-native-webrtc": "github:jitsi/react-native-webrtc#4064c6f2db4f8b961daaaa8dafc6a896d7cfbc43",
"react-native-webview": "5.8.1", "react-native-webview": "5.8.1",
"react-redux": "5.0.7", "react-redux": "5.0.7",
"react-textarea-autosize": "7.1.0",
"react-transition-group": "2.4.0", "react-transition-group": "2.4.0",
"redux": "4.0.0", "redux": "4.0.0",
"redux-thunk": "2.2.0", "redux-thunk": "2.2.0",

View File

@ -2,6 +2,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import Emoji from 'react-emoji-render'; import Emoji from 'react-emoji-render';
import TextareaAutosize from 'react-textarea-autosize';
import type { Dispatch } from 'redux'; import type { Dispatch } from 'redux';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
@ -114,12 +115,14 @@ class ChatInput extends Component<Props, State> {
</div> </div>
</div> </div>
<div className = 'usrmsg-form'> <div className = 'usrmsg-form'>
<textarea <TextareaAutosize
id = 'usermsg' id = 'usermsg'
inputRef = { this._setTextAreaRef }
maxRows = { 5 }
minRows = { 2 }
onChange = { this._onMessageChange } onChange = { this._onMessageChange }
onKeyDown = { this._onDetectSubmit } onKeyDown = { this._onDetectSubmit }
placeholder = { this.props.t('chat.messagebox') } placeholder = { this.props.t('chat.messagebox') }
ref = { this._setTextAreaRef }
value = { this.state.message } /> value = { this.state.message } />
</div> </div>
</div> </div>