mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 修复inputRef类型错误 (#5806)
This commit is contained in:
parent
8b45ab165f
commit
5e3c59cb1c
@ -59,7 +59,7 @@ export interface TextAreaProps extends ThemeProps, LocaleProps {
|
||||
name?: string;
|
||||
disabled?: boolean;
|
||||
|
||||
forwardRef?: {current: HTMLInputElement | null};
|
||||
forwardRef?: {current: HTMLTextAreaElement | null};
|
||||
}
|
||||
|
||||
export interface TextAreaState {
|
||||
@ -79,9 +79,9 @@ export class Textarea extends React.Component<TextAreaProps, TextAreaState> {
|
||||
focused: false
|
||||
};
|
||||
|
||||
input?: HTMLInputElement;
|
||||
inputRef = (ref: HTMLInputElement) => {
|
||||
this.input = findDOMNode(ref) as HTMLInputElement;
|
||||
input?: HTMLTextAreaElement;
|
||||
inputRef = (ref: HTMLTextAreaElement) => {
|
||||
this.input = findDOMNode(ref) as HTMLTextAreaElement;
|
||||
if (this.props.forwardRef) {
|
||||
this.props.forwardRef.current = this.input;
|
||||
}
|
||||
|
@ -274,13 +274,14 @@ test('Renderer:input-table with combo column', async () => {
|
||||
|
||||
await wait(300);
|
||||
expect(onSubmit).toBeCalledTimes(2);
|
||||
|
||||
expect(onSubmit.mock.calls[1][0]).toEqual({
|
||||
table: [
|
||||
{
|
||||
q2: '1',
|
||||
q1: {
|
||||
score: 99,
|
||||
comment: 'this is comment msg!'
|
||||
comment: 'this is comment msg!',
|
||||
score: 99
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user