Fix ConfirmUserActionDialog returning an input field rather than text

This commit is contained in:
Michael Telatynski 2021-06-19 15:57:07 +01:00
parent 2c66adcb0e
commit 2c5ddea1d9

View file

@ -38,7 +38,7 @@ interface IProps {
// be the string entered. // be the string entered.
askReason?: boolean; askReason?: boolean;
danger?: boolean; danger?: boolean;
onFinished: (success: boolean, reason?: HTMLInputElement) => void; onFinished: (success: boolean, reason?: string) => void;
} }
/* /*
@ -59,11 +59,7 @@ export default class ConfirmUserActionDialog extends React.Component<IProps> {
}; };
public onOk = (): void => { public onOk = (): void => {
let reason; this.props.onFinished(true, this.reasonField.current?.value);
if (this.reasonField) {
reason = this.reasonField.current;
}
this.props.onFinished(true, reason);
}; };
public onCancel = (): void => { public onCancel = (): void => {