wip: update docs
This commit is contained in:
@@ -180,6 +180,41 @@ The system supports real-time field state updates:
|
||||
3. HTMX can update field states without full page refresh
|
||||
4. Dependency tracking ensures only affected fields are updated
|
||||
|
||||
### Service Field HTMX Integration Improvements
|
||||
|
||||
**Critical Fix for Expanded Choice Fields**: Service fields (board, skipass, courses, etc.) use expanded choice types (checkboxes/radios) which required special HTMX trigger handling:
|
||||
|
||||
**Issue Resolved**: HTMX attributes were originally placed on container elements (`row_attr`) which don't capture individual input changes for expanded choice fields.
|
||||
|
||||
**Solution Implemented**: HTMX triggers must be placed directly on each individual checkbox/radio input via the `attr` configuration:
|
||||
|
||||
```php
|
||||
// Correct implementation for service fields
|
||||
'attr' => [
|
||||
'hx-post' => $this->urlGenerator->generate('booking_create_step_2_refresh'),
|
||||
'hx-target' => '#booking-summary',
|
||||
'hx-trigger' => 'change',
|
||||
],
|
||||
|
||||
// Incorrect approach (doesn't work for expanded choices)
|
||||
// 'row_attr' => ['hx-post' => '...']
|
||||
```
|
||||
|
||||
**Benefits of the Fix**:
|
||||
- Real-time updates now work reliably for all service field selections
|
||||
- Service pricing calculations update immediately when selections change
|
||||
- Booking summary reflects service changes without manual form submission
|
||||
- Consistent HTMX behavior across all form field types
|
||||
|
||||
**Affected Field Types**:
|
||||
- Board/meal selection fields
|
||||
- Ski pass selection fields
|
||||
- Course selection fields
|
||||
- Additional services selection fields
|
||||
- Rental equipment selection fields
|
||||
|
||||
This improvement ensures that the conditional field state system works seamlessly with HTMX for all field types, providing users with immediate feedback on their selections.
|
||||
|
||||
## Extending the System
|
||||
|
||||
### Custom Conditions
|
||||
|
||||
Reference in New Issue
Block a user