mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 22:15:35 +00:00
refactor: replace random ID generation with Cuid2 for unique HTML IDs in form components
This commit is contained in:
1 parent
a5c6f53b58
commit
d2a334df78
5 files changed
+6
-6
No files matched your search
@@ -57,7 +57,7 @@ class Select extends Component
|
||||
// This prevents duplicate IDs when multiple forms are on the same page
|
||||
if ($this->modelBinding && $this->modelBinding !== 'null') {
|
||||
// Use original ID with random suffix for uniqueness
|
||||
$uniqueSuffix = substr(md5(uniqid((string) mt_rand(), true)), 0, 8);
|
||||
$uniqueSuffix = new Cuid2;
|
||||
$this->htmlId = $this->modelBinding.'-'.$uniqueSuffix;
|
||||
} else {
|
||||
$this->htmlId = (string) $this->id;
|
||||
|
||||
Reference in new issue
Block a user