From 4f0349b012d3422da055c7f748780e6508669769 Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:10:48 +0200 Subject: [PATCH] fix: added block id to date ids to ensure unique field ids (#771) Co-authored-by: Martina Bustacchini <41484878+deodorhunter@users.noreply.github.com> --- src/components/ItaliaTheme/Blocks/BandiSearch/Body.jsx | 3 +++ .../ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx | 5 +++-- src/components/ItaliaTheme/Blocks/EventSearch/Body.jsx | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ItaliaTheme/Blocks/BandiSearch/Body.jsx b/src/components/ItaliaTheme/Blocks/BandiSearch/Body.jsx index 962b4a015..0f678b268 100644 --- a/src/components/ItaliaTheme/Blocks/BandiSearch/Body.jsx +++ b/src/components/ItaliaTheme/Blocks/BandiSearch/Body.jsx @@ -167,6 +167,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => { <> {React.createElement(filterOne.widget.component, { ...filterOne.widget?.props, + blockID: id, id: 'filterOne', onChange: (filter, value) => { dispatchFilter({ @@ -180,6 +181,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => { {filterTwo && React.createElement(filterTwo.widget?.component, { ...filterTwo.widget?.props, + blockID: id, id: 'filterTwo', onChange: (filter, value) => dispatchFilter({ @@ -190,6 +192,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => { {filterThree && React.createElement(filterThree.widget?.component, { ...filterThree.widget?.props, + blockID: id, id: 'filterThree', onChange: (filter, value) => dispatchFilter({ diff --git a/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx b/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx index d93d7ebd8..afddc0852 100644 --- a/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx +++ b/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx @@ -188,6 +188,7 @@ const DateFilter = (props) => { endLabel, defaultStart, defaultEnd, + blockID, ...rest } = props; const { DateRangePicker } = reactDates; @@ -230,12 +231,12 @@ const DateFilter = (props) => { { <> {React.createElement(filterOne.widget.component, { ...filterOne.widget?.props, + blockID: id, id: 'filterOne', onChange: (filter, value) => { dispatchFilter({ @@ -195,6 +196,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => { {filterTwo && React.createElement(filterTwo.widget?.component, { ...filterTwo.widget?.props, + blockID: id, id: 'filterTwo', onChange: (filter, value) => dispatchFilter({ @@ -205,6 +207,7 @@ const Body = ({ data, id, inEditMode, path, onChangeBlock }) => { {filterThree && React.createElement(filterThree.widget?.component, { ...filterThree.widget?.props, + blockID: id, id: 'filterThree', onChange: (filter, value) => dispatchFilter({