Skip to content

Commit e13320d

Browse files
committed
pass row props to internal textarea
1 parent afcd9c4 commit e13320d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/basic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Demo extends React.Component {
2424
<div>
2525
<Mentions
2626
autoFocus
27+
rows={3}
2728
defaultValue="Hello World"
2829
onSelect={this.onSelect}
2930
onFocus={this.onFocus}

src/Mentions.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface MentionsProps {
3232
validateSearch?: typeof defaultValidateSearch;
3333
filterOption?: false | typeof defaultFilterOption;
3434
notFoundContent?: React.ReactNode;
35+
rows?: number;
3536
}
3637
interface MentionsState {
3738
value: string;
@@ -52,6 +53,7 @@ class Mentions extends React.Component<MentionsProps, MentionsState> {
5253
validateSearch: defaultValidateSearch,
5354
filterOption: defaultFilterOption,
5455
notFoundContent: 'Not Found',
56+
rows: 1,
5557
};
5658

5759
public static getDerivedStateFromProps(props: MentionsProps, prevState: MentionsState) {
@@ -309,7 +311,7 @@ class Mentions extends React.Component<MentionsProps, MentionsState> {
309311

310312
public render() {
311313
const { value, measureLocation, measurePrefix, measuring, activeIndex } = this.state;
312-
const { prefixCls, className, style, autoFocus, notFoundContent } = this.props;
314+
const { prefixCls, className, style, autoFocus, notFoundContent, rows } = this.props;
313315

314316
const options = measuring ? this.getOptions() : [];
315317

@@ -319,6 +321,7 @@ class Mentions extends React.Component<MentionsProps, MentionsState> {
319321
autoFocus={autoFocus}
320322
ref={this.setTextAreaRef}
321323
value={value}
324+
rows={rows}
322325
onChange={this.onChange}
323326
onKeyDown={this.onKeyDown}
324327
onKeyUp={this.onKeyUp}

0 commit comments

Comments
 (0)