style: Update z-index in PortalDropdown component to use a constant for improved maintainability and clarity
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 16m47s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 16m47s
This commit is contained in:
@@ -18,6 +18,7 @@ function PortalDropdown({
|
||||
const menuRef = useRef(null);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [coords, setCoords] = useState({ top: 0, left: 0, minWidth: 0 });
|
||||
const BASE_Z = 1035; // above navbar (1030), below modal-backdrop (1040) and modal (1050)
|
||||
|
||||
const updatePosition = () => {
|
||||
const btn = buttonRef.current;
|
||||
@@ -78,7 +79,7 @@ function PortalDropdown({
|
||||
{open && body && createPortal(
|
||||
<div
|
||||
ref={menuRef}
|
||||
style={{ position: 'absolute', top: `${coords.top}px`, left: `${coords.left}px`, zIndex: 10000, minWidth: `${coords.minWidth}px` }}
|
||||
style={{ position: 'absolute', top: `${coords.top}px`, left: `${coords.left}px`, zIndex: BASE_Z, minWidth: `${coords.minWidth}px` }}
|
||||
>
|
||||
<div className={menuClassName} style={{ display: 'block' }}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user