You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FloatingFocus utility fails to work on elements with IDs containing special characters, such as those generated by React's useId(). This occurs because the current implementation relies on document.querySelector, which does not support special characters in CSS selectors without escaping.
SyntaxError: Failed to execute 'querySelector' on 'Document': '#downshift-:Rjdj4vepjt6:-input' is not a valid selector.
The ids generated by useId() contain special characters (e.g. :r0:), which are valid in HTML but are not valid unescaped CSS selectors.
Suggested Fix
Replace the current document.querySelector call with document.getElementById, which natively supports special characters.
Issue
The
FloatingFocus
utility fails to work on elements with IDs containing special characters, such as those generated by React'suseId()
. This occurs because the current implementation relies ondocument.querySelector
, which does not support special characters in CSS selectors without escaping.The ids generated by
useId()
contain special characters (e.g.:r0:
), which are valid in HTML but are not valid unescaped CSS selectors.Suggested Fix
Replace the current
document.querySelector
call withdocument.getElementById
, which natively supports special characters.current code:
suggested fix:
Potential Test Case
The text was updated successfully, but these errors were encountered: