diff options
Diffstat (limited to 'vnext/src/ui/MessageInput.js')
-rw-r--r-- | vnext/src/ui/MessageInput.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vnext/src/ui/MessageInput.js b/vnext/src/ui/MessageInput.js index bc9ddd54..e19136d4 100644 --- a/vnext/src/ui/MessageInput.js +++ b/vnext/src/ui/MessageInput.js @@ -26,11 +26,13 @@ function moveCaretToEnd(el) { * @property {string} text * @property {import('../api').Message} data * @property {function} onSend + * @property {number} rows + * @property {string} children */ /** * MessageInput - * @param {HTMLTextAreaElement & MessageInputProps} props + * @param {React.ReactNode & MessageInputProps} props */ export default function MessageInput({ text, data, rows, children, onSend }) { /** @@ -98,7 +100,7 @@ export default function MessageInput({ text, data, rows, children, onSend }) { <div style={commentStyle}> <textarea onChange={textChanged} onKeyPress={handleCtrlEnter} ref={textareaRef} style={textInputStyle} - rows={rows || '1'} placeholder={children} value={body} /> + rows={rows || 1} placeholder={children} value={body} /> <div style={inputBarStyle}> <UploadButton inputRef={fileinput} value={attach} onChange={uploadValueChanged} /> <Button onClick={onSubmit}><Icon name="ei-envelope" size="s" />Send</Button> @@ -108,6 +110,9 @@ export default function MessageInput({ text, data, rows, children, onSend }) { ); } +/** + * @type {React.CSSProperties} + */ const commentStyle = { display: 'flex', flexDirection: 'column', @@ -115,6 +120,9 @@ const commentStyle = { marginTop: '10px' }; +/** + * @type {React.CSSProperties} + */ const inputBarStyle = { display: 'flex', alignItems: 'center', @@ -122,6 +130,9 @@ const inputBarStyle = { padding: '3px' }; +/** + * @type {React.CSSProperties} + */ const textInputStyle = { overflow: 'hidden', resize: 'none', |