Files
formbricks/apps/web/app/lib/actionClass/actionClass.ts
Piyush Gupta 6bfd02794d feat: Refactor Triggers and combine Action Classes and Inline Triggers (#2562)
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
Co-authored-by: Johannes <johannes@formbricks.com>
2024-05-07 13:47:41 +00:00

13 lines
277 B
TypeScript

export const isValidCssSelector = (selector?: string) => {
if (!selector || selector.length === 0) {
return false;
}
const element = document.createElement("div");
try {
element.querySelector(selector);
} catch (err) {
return false;
}
return true;
};