From 2b88437b144998948011498672d7641ea26118dc Mon Sep 17 00:00:00 2001 From: merelendor Date: Wed, 12 Apr 2023 14:17:32 +0300 Subject: [PATCH] update for PDF generation --- components/questionnaire/AddressSuggests.js | 12 +++++++----- .../questionnaire/forms/Form_4_Shareholders/index.js | 2 +- pages/api/questionnaire/download.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/questionnaire/AddressSuggests.js b/components/questionnaire/AddressSuggests.js index 79a251b..6c5cf1f 100644 --- a/components/questionnaire/AddressSuggests.js +++ b/components/questionnaire/AddressSuggests.js @@ -57,10 +57,12 @@ export default class AddressSuggests extends React.Component const { fias, focused } = this.state; const { onChange } = this.props; - this.setState({ focused: false }, () => + onChange({ name: value, fias_id: fias[value] }); + + setTimeout(() => { - onChange({ name: value, fias_id: fias[value] }); - }); + this.setState({ focused: false }); + }, 200); } _handle_onFocus = (event) => @@ -79,7 +81,7 @@ export default class AddressSuggests extends React.Component setTimeout(() => { this.setState({ focused: false }); - }, 100); + }, 200); } _getAddress = (text) => @@ -147,7 +149,7 @@ export default class AddressSuggests extends React.Component
{ options.map((option, index) => ( -
{ event.preventDefault(); this._handle_onSelect(option.value); } }>{ option.value }
+
{ event.preventDefault(); this._handle_onSelect(option.value); } }>{ option.value }
)) }
diff --git a/components/questionnaire/forms/Form_4_Shareholders/index.js b/components/questionnaire/forms/Form_4_Shareholders/index.js index 16ed3e9..b249121 100644 --- a/components/questionnaire/forms/Form_4_Shareholders/index.js +++ b/components/questionnaire/forms/Form_4_Shareholders/index.js @@ -439,7 +439,7 @@ class Shareholder extends React.Component name={ `founder_persons[${ index }].founder_part` } value={ this._checkStrValue(shareholder.founder_part) } placeholder="Укажите размер доли" - onChange={ (event) => { this._removeError("founder_part"); this._handle_onTextFieldChange(event.target.name, event.target.value > 100 ? 100 : event.target.value); } } + onChange={ (event) => { this._removeError("founder_part"); this._handle_onTextFieldChange(event.target.name, parseInt(event.target.value, 10) > 100 ? 100 : parseInt(event.target.value, 10)); } } required={ true } disabled={ checking } /> diff --git a/pages/api/questionnaire/download.js b/pages/api/questionnaire/download.js index a5d2a3b..54f5b06 100644 --- a/pages/api/questionnaire/download.js +++ b/pages/api/questionnaire/download.js @@ -37,7 +37,7 @@ const fields = { collective_executive: { name: "execution_team", type: "text", bind: null, size: 6 }, individual_executive: { name: "execution_sole", type: "text", bind: null, size: 6 }, other_control: { name: "execution_another", type: "text", bind: null, size: 6 }, - mail_delivery_address_type: { name: "mail_delivery_address_type", type: "radio", bind: null }, + mail_delivery_address_type: { name: "address_type", type: "radio", bind: null }, }, contacts: { fact_address: { name: "address_fact", type: "text", bind: null },