Skip to content

Commit

Permalink
fix(fields): handle id with special chars in Select pointer-events hack
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Sep 26, 2024
1 parent 9ca5417 commit 271e475
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fields/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function Select<OptionValue extends OptionValueType = string>({
return
}

const divs = boxRef.current.querySelectorAll(`#${originalProps.name}-listbox div`)
const divs = boxRef.current.querySelectorAll<HTMLDivElement>(`[id="${originalProps.name}-listbox"] div`)
const targetDiv = divs[2]

/**
Expand All @@ -154,7 +154,7 @@ export function Select<OptionValue extends OptionValueType = string>({
*/
if (targetDiv) {
requestAnimationFrame(() => {
;(targetDiv as HTMLDivElement).style.pointerEvents = 'auto'
targetDiv.style.pointerEvents = 'auto'
})
}
}, 300)
Expand Down

0 comments on commit 271e475

Please sign in to comment.