diff --git a/packages/sage-system/lib/dropdown.js b/packages/sage-system/lib/dropdown.js index f1a35d6171..c0134fbbf4 100644 --- a/packages/sage-system/lib/dropdown.js +++ b/packages/sage-system/lib/dropdown.js @@ -190,8 +190,12 @@ Sage.dropdown = (function () { } function positionElement(el) { + // Guard clause to check if wrapperRef.current is null + if (!wrapperRef.current) return; + let directionX = null; let directionY = null; + const el = wrapperRef.current; // Elements const button = el;