shuriken-ui / nuxt

Nuxt version of Shuriken UI with ready to use components
https://shurikenui.com/
MIT License
139 stars 18 forks source link

bug: crypto.randomUUID not supported in some browsers #120

Closed ibrunotome closed 2 months ago

ibrunotome commented 2 months ago

The input id generation assumes that user browser has support for the browser crypto api:

https://github.com/shuriken-ui/nuxt/blob/2a2b889f2fc27bcb4ddb21869dd1cc26b19c665a/composables/input-id.ts#L16

This was released in version 92 of chrome for android https://caniuse.com/?search=randomuuid, but some users still stucked in old versions:

Screenshot 2024-04-30 at 10 21 02 Screenshot 2024-04-30 at 10 21 42

Proposal: replace crypto.randomUUID for something like random bytes or timestamp based id.