mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +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;
|
name?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
|
||||||
forwardRef?: {current: HTMLInputElement | null};
|
forwardRef?: {current: HTMLTextAreaElement | null};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TextAreaState {
|
export interface TextAreaState {
|
||||||
@ -79,9 +79,9 @@ export class Textarea extends React.Component<TextAreaProps, TextAreaState> {
|
|||||||
focused: false
|
focused: false
|
||||||
};
|
};
|
||||||
|
|
||||||
input?: HTMLInputElement;
|
input?: HTMLTextAreaElement;
|
||||||
inputRef = (ref: HTMLInputElement) => {
|
inputRef = (ref: HTMLTextAreaElement) => {
|
||||||
this.input = findDOMNode(ref) as HTMLInputElement;
|
this.input = findDOMNode(ref) as HTMLTextAreaElement;
|
||||||
if (this.props.forwardRef) {
|
if (this.props.forwardRef) {
|
||||||
this.props.forwardRef.current = this.input;
|
this.props.forwardRef.current = this.input;
|
||||||
}
|
}
|
||||||
|
@ -274,13 +274,14 @@ test('Renderer:input-table with combo column', async () => {
|
|||||||
|
|
||||||
await wait(300);
|
await wait(300);
|
||||||
expect(onSubmit).toBeCalledTimes(2);
|
expect(onSubmit).toBeCalledTimes(2);
|
||||||
|
|
||||||
expect(onSubmit.mock.calls[1][0]).toEqual({
|
expect(onSubmit.mock.calls[1][0]).toEqual({
|
||||||
table: [
|
table: [
|
||||||
{
|
{
|
||||||
q2: '1',
|
q2: '1',
|
||||||
q1: {
|
q1: {
|
||||||
score: 99,
|
comment: 'this is comment msg!',
|
||||||
comment: 'this is comment msg!'
|
score: 99
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user