From 271e475b33fa570269925b6127f6c035be86aa60 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Thu, 26 Sep 2024 14:59:50 +0200 Subject: [PATCH] fix(fields): handle id with special chars in Select pointer-events hack --- src/fields/Select.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fields/Select.tsx b/src/fields/Select.tsx index 815b2948e..9686416b1 100644 --- a/src/fields/Select.tsx +++ b/src/fields/Select.tsx @@ -143,7 +143,7 @@ export function Select({ return } - const divs = boxRef.current.querySelectorAll(`#${originalProps.name}-listbox div`) + const divs = boxRef.current.querySelectorAll(`[id="${originalProps.name}-listbox"] div`) const targetDiv = divs[2] /** @@ -154,7 +154,7 @@ export function Select({ */ if (targetDiv) { requestAnimationFrame(() => { - ;(targetDiv as HTMLDivElement).style.pointerEvents = 'auto' + targetDiv.style.pointerEvents = 'auto' }) } }, 300)