diff --git a/.changeset/late-cameras-roll.md b/.changeset/late-cameras-roll.md new file mode 100644 index 000000000..158eb55ef --- /dev/null +++ b/.changeset/late-cameras-roll.md @@ -0,0 +1,5 @@ +--- +'@lowdefy/blocks-antd': patch +--- + +Bug fix: Randomize popup dom element ids to better attach on block reuse on page. diff --git a/packages/plugins/blocks/blocks-antd/src/blocks/DateRangeSelector/DateRangeSelector.js b/packages/plugins/blocks/blocks-antd/src/blocks/DateRangeSelector/DateRangeSelector.js index 42236afa7..352ad2437 100644 --- a/packages/plugins/blocks/blocks-antd/src/blocks/DateRangeSelector/DateRangeSelector.js +++ b/packages/plugins/blocks/blocks-antd/src/blocks/DateRangeSelector/DateRangeSelector.js @@ -14,7 +14,7 @@ limitations under the License. */ -import React from 'react'; +import React, { useState } from 'react'; import { DatePicker } from 'antd'; import moment from 'moment'; import { blockDefaultProps } from '@lowdefy/block-utils'; @@ -42,6 +42,7 @@ const DateRangeSelector = ({ validation, value, }) => { + const [elementId] = useState((0 | (Math.random() * 9e2)) + 1e2); return (