useId return value is incompatible with document.querySelector · Issue #11828 · vuejs/core (original) (raw)
Vue version
3.5.0
Link to minimal reproduction
Steps to reproduce
Use document.querySelector
with an id generated by useId()
What is expected?
I would expect querySelector
to work without thinking about escaping ID values for document.querySelector
. The colon in the returned IDs is hardcoded in the vue useId
function and can not be customized. I think handling these default values with colon is rather counter-intuitive.
What is actually happening?
Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document'
System Info
No response
Any additional comments?
Maybe use something different than colon as separator?