mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 23:20:43 +00:00
refactor: replace random ID generation with Cuid2 for unique HTML IDs in form components
This commit is contained in:
@@ -71,7 +71,7 @@ class Textarea 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