diff --git a/src/bundle/Resources/public/js/scripts/helpers/react.helper.js b/src/bundle/Resources/public/js/scripts/helpers/react.helper.js index 7b32f1f85b..df9511f5e2 100644 --- a/src/bundle/Resources/public/js/scripts/helpers/react.helper.js +++ b/src/bundle/Resources/public/js/scripts/helpers/react.helper.js @@ -1,4 +1,10 @@ -const createDynamicRoot = (contextDOMElement = window.document.body, id) => { +import { getRootDOMElement } from './context.helper'; + +const createDynamicRoot = ({ contextDOMElement = getRootDOMElement(), id } = {}) => { + if (id && contextDOMElement.querySelector(`#${id}`) !== null) { + console.warn(`You're creating second root element with ID "${id}". IDs should be unique inside a document.`); + } + const rootDOMElement = document.createElement('div'); rootDOMElement.classList.add('ibexa-react-root'); diff --git a/src/bundle/ui-dev/src/modules/common/popup-menu/popup.menu.js b/src/bundle/ui-dev/src/modules/common/popup-menu/popup.menu.js index 7625ba3120..51ddae3e47 100644 --- a/src/bundle/ui-dev/src/modules/common/popup-menu/popup.menu.js +++ b/src/bundle/ui-dev/src/modules/common/popup-menu/popup.menu.js @@ -43,23 +43,15 @@ const PopupMenu = ({ extraClasses, footer, items, onItemClick, positionOffset, r return null; } - const groupClassName = createCssClassNames({ - 'c-popup-menu__group': true, - }); - - return