Skip to content

Commit 2d6d636

Browse files
committed
fix: [Composer] the input box displays one row by default
1 parent 07eeaa3 commit 2d6d636

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/Composer/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import clsx from 'clsx';
44
import { IconButtonProps } from '../IconButton';
55
import { Input } from '../Input';
66
import { Recorder, RecorderProps } from '../Recorder';
7-
import { Toolbar } from '../Toolbar';
7+
import { Toolbar, ToolbarItemProps } from '../Toolbar';
88
import { ClickOutside } from '../ClickOutside';
99
import { Popover } from '../Popover';
1010
import { SendConfirm } from '../SendConfirm';
@@ -13,7 +13,6 @@ import { Action } from './Action';
1313
import riseInput from './riseInput';
1414
import parseDataTransfer from '../../utils/parseDataTransfer';
1515
import toggleClass from '../../utils/toggleClass';
16-
import { ToolbarItemProps } from '../Toolbar';
1716

1817
const NO_HOME_BAR = 'S--noHomeBar';
1918

@@ -238,12 +237,11 @@ export const Composer = React.forwardRef<ComposerHandle, ComposerProps>((props,
238237
const inputTypeIcon = isInputText ? 'mic' : 'keyboard';
239238
const hasToolbar = toolbar.length > 0;
240239

241-
const renderInput = (minRows: number) => (
240+
const renderInput = () => (
242241
<div className={clsx({ 'S--invisible': !isInputText })}>
243242
<Input
244243
className="Composer-input"
245244
value={text}
246-
minRows={minRows}
247245
rows={1}
248246
autoSize
249247
ref={inputRef}
@@ -284,7 +282,7 @@ export const Composer = React.forwardRef<ComposerHandle, ComposerProps>((props,
284282
{accessoryContent}
285283
</Popover>
286284
)}
287-
<div className="Composer-inputWrap">{renderInput(3)}</div>
285+
<div className="Composer-inputWrap">{renderInput()}</div>
288286
<Action
289287
className="Composer-sendBtn"
290288
icon="paper-plane"
@@ -310,7 +308,7 @@ export const Composer = React.forwardRef<ComposerHandle, ComposerProps>((props,
310308
/>
311309
)}
312310
<div className="Composer-inputWrap">
313-
{renderInput(1)}
311+
{renderInput()}
314312
{!isInputText && <Recorder {...recorder} />}
315313
</div>
316314
{!text && rightAction && <Action {...rightAction} />}

0 commit comments

Comments
 (0)