diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index 2a20a7855a..bc3cf20f9c 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -347,11 +347,14 @@ export const Dialog = React.forwardRef((props, ref) => { }; useMountEffect(() => { + const unqiueId = UniqueComponentId(); if (!idState) { - setIdState(UniqueComponentId()); + setIdState(unqiueId); } - attributeSelector.current = UniqueComponentId(); + if (!attributeSelector.current) { + attributeSelector.current = unqiueId; + } if (props.visible) { setMaskVisibleState(true);