From ed3472b0e2b38058bc8964edfd9d8353c392a4c5 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Fri, 31 May 2024 14:23:50 +0200 Subject: [PATCH] [core] Comment on CSS.escape for the future --- packages/x-data-grid/src/utils/domUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/x-data-grid/src/utils/domUtils.ts b/packages/x-data-grid/src/utils/domUtils.ts index 9ca1179b6aab..5d19c58809cb 100644 --- a/packages/x-data-grid/src/utils/domUtils.ts +++ b/packages/x-data-grid/src/utils/domUtils.ts @@ -10,6 +10,8 @@ export function findParentElementFromClassName(elem: Element, className: string) return elem.closest(`.${className}`); } +// TODO, eventually replaces this function with CSS.escape, once available in jsdom, either added manually or built in +// https://github.com/jsdom/jsdom/issues/1550#issuecomment-236734471 export function escapeOperandAttributeSelector(operand: string): string { return operand.replace(/["\\]/g, '\\$&'); }