Commit a63c931f authored by Andrei Mondoc's avatar Andrei Mondoc
Browse files

fix select controls, save IDs as string

parent 4568b384
...@@ -51,7 +51,9 @@ const SelectContributionPageControl = ({ id, setAttributes }) => { ...@@ -51,7 +51,9 @@ const SelectContributionPageControl = ({ id, setAttributes }) => {
<Select <Select
placeholder={__('Select a Contribution page', 'civicrm')} placeholder={__('Select a Contribution page', 'civicrm')}
value={contributionPage || 0} value={contributionPage || 0}
onChange={(option) => setAttributes({ id: option.value })} onChange={(option) =>
setAttributes({ id: option.value.toSring() })
}
options={contributionPages} options={contributionPages}
components={{ Option: ContributionPageOption }} components={{ Option: ContributionPageOption }}
/> />
......
...@@ -64,7 +64,9 @@ const SelectEventControl = ({ id, setAttributes }) => { ...@@ -64,7 +64,9 @@ const SelectEventControl = ({ id, setAttributes }) => {
<Select <Select
placeholder={__('Select an Event', 'civicrm')} placeholder={__('Select an Event', 'civicrm')}
value={event || 0} value={event || 0}
onChange={(option) => setAttributes({ id: option.value })} onChange={(option) =>
setAttributes({ id: option.value.toSring() })
}
options={events} options={events}
components={{ Option: EventOption }} components={{ Option: EventOption }}
/> />
......
...@@ -50,7 +50,9 @@ const SelectProfileControl = ({ gid, setAttributes }) => { ...@@ -50,7 +50,9 @@ const SelectProfileControl = ({ gid, setAttributes }) => {
<Select <Select
placeholder={__('Select a Profile', 'civicrm')} placeholder={__('Select a Profile', 'civicrm')}
value={profile || 0} value={profile || 0}
onChange={(option) => setAttributes({ gid: option.value })} onChange={(option) =>
setAttributes({ gid: option.value.toString() })
}
options={profiles} options={profiles}
components={{ Option: ProfileOption }} components={{ Option: ProfileOption }}
/> />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment