@ariakit/react-core
Version:
Ariakit React core
17 lines (14 loc) • 395 B
JavaScript
"use client";
// src/dialog/utils/is-backdrop.ts
function isBackdrop(element, ...ids) {
if (!element) return false;
const backdrop = element.getAttribute("data-backdrop");
if (backdrop == null) return false;
if (backdrop === "") return true;
if (backdrop === "true") return true;
if (!ids.length) return true;
return ids.some((id) => backdrop === id);
}
export {
isBackdrop
};