Commit graph

24 commits

Author SHA1 Message Date
Andras Bacsai
d2a334df78 refactor: replace random ID generation with Cuid2 for unique HTML IDs in form components 2025-10-16 12:54:14 +02:00
Andras Bacsai
598984f291 Fix wire:model warnings and ensure truly unique HTML IDs
**Problems Fixed:**
1. Livewire warnings about non-existent properties (e.g., wire:model="dcgoowgw0gcgcsgg00c8kskc")
2. Duplicate HTML IDs still appearing despite initial fix

**Root Causes:**
1. Auto-generated Cuid2 IDs were being used for wire:model when no explicit id was provided
2. Livewire's wire:id attribute isn't available during server-side rendering

**Solutions:**
1. Set $modelBinding to 'null' (string) when id is not provided, preventing invalid wire:model generation
2. Use random MD5 suffix instead of Livewire component ID for guaranteed uniqueness during initial render
3. Maintain correct $name attribute based on original property name

**Technical Changes:**
- Input, Textarea, Select, Datalist: Use random 8-char suffix for uniqueness
- Checkbox: Apply same random suffix approach
- wire:model now only created for explicit property names
- HTML IDs are unique from initial server render (no hydration required)

**Result:**
 No more Livewire property warnings
 Truly unique HTML IDs across all components
 wire:model bindings work correctly
 Validation and form submission unaffected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:32:49 +02:00
Andras Bacsai
a514c837b6 Fix duplicate HTML ID warnings in form components
Resolve browser console warnings about non-unique HTML IDs when multiple
Livewire components with similar form fields appear on the same page.

**Problem:**
Multiple forms using generic IDs like `id="description"` or `id="name"`
caused duplicate ID warnings and potential accessibility/JavaScript issues.

**Solution:**
- Separate `wire:model` binding name from HTML `id` attribute
- Auto-prefix HTML IDs with Livewire component ID for uniqueness
- Preserve existing `wire:model` behavior with property names

**Implementation:**
- Added `$modelBinding` property for wire:model (e.g., "description")
- Added `$htmlId` property for unique HTML ID (e.g., "lw-xyz123-description")
- Updated render() method to generate unique IDs automatically
- Updated all blade templates to use new properties

**Components Updated:**
- Input (text, password, etc.)
- Textarea (including Monaco editor)
- Select
- Checkbox
- Datalist (single & multiple selection)

**Result:**
 All HTML IDs now unique across page
 No console warnings
 wire:model bindings work correctly
 Validation error messages display correctly
 Backward compatible - no changes needed in existing components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:27:41 +02:00
Andras Bacsai
63fcc0ebc3 feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled. 2025-08-26 10:27:38 +02:00
Andras Bacsai
1ddec358a5 feat(input): add autofocus attribute to input component for improved accessibility 2025-08-12 10:06:19 +02:00
Andras Bacsai
8c9989136b fix: remove livewire legacy from help view 2024-11-03 21:27:26 +01:00
Andras Bacsai
96b8ddf664 chore: Add autocomplete attribute to input fields 2024-09-27 16:32:03 +02:00
andrasbacsai
96c4f5b8da Fix styling 2024-07-25 11:31:59 +00:00
Andras Bacsai
6a4aa492c0 fix: random generated uuid will be full length (not 7 characters) 2024-07-25 13:31:01 +02:00
andrasbacsai
d1a5f97f59 Fix styling 2024-06-19 06:59:46 +00:00
Thijmen
d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai
2f50f64ecf Update input component and toast position 2024-03-22 13:09:02 +01:00
Andras Bacsai
b61860b3ab ui: redesign 2024-03-20 12:54:06 +01:00
Andras Bacsai
91950e1891 ui: redesign 2024-03-19 15:37:16 +01:00
Andras Bacsai
faa9a982a9 fix: multiline input 2024-03-18 12:28:53 +01:00
Andras Bacsai
657c7d8cff Refactor form components
Update Input and Textarea components to use nullable type declarations and remove unused imports.
2024-03-15 20:40:50 +01:00
Andras Bacsai
db0e3cfcc4 fix: database proxy for services
version++
tiny css modifications
2023-11-10 09:41:42 +01:00
Andras Bacsai
82a01b4483 format muhahaha 2023-08-11 20:48:52 +02:00
Andras Bacsai
b4b1c671bd fix: input and textarea 2023-08-08 14:46:23 +02:00
Andras Bacsai
f2228cec7b testing php storm code cleanup and styling 2023-08-08 11:51:36 +02:00
Andras Bacsai
7e4b1a8f8f refactor 2023-07-28 10:55:26 +02:00
Andras Bacsai
9f4342bd19 wip 2023-07-14 12:09:56 +02:00
Andras Bacsai
a0b2868e95 UI stuffs 2023-07-13 13:16:24 +02:00
Andras Bacsai
05c9126184 updates 2023-06-16 10:32:29 +02:00