F
Filamentβ€’6mo ago
Marco

Select input value not set in dynamically created Tab component

Attached is a simplified version of the Form that i have. I dynamically add tabs based on the machines i select. In the dynamically created Tab I have a select component with options. If I select an option and submit the Form the value of the select will remain "null". I get the following error when the Tab is dynamically created:
Livewire Entangle Error: Livewire property ['data.1_machine_option'] cannot be found on component:
Livewire Entangle Error: Livewire property ['data.1_machine_option'] cannot be found on component:
It seems like its looking for the field in the 'original' form data, when i create this tab. Is there a way to accomplice the scenario that i want? Note: Components like TextInputs and Checkboxes work fine, I only have the problem with the Select component
1 Reply
Marco
MarcoOPβ€’6mo ago
Is there anyone who can help me? I fixed it by adding:
if ($get($$selectedMachine . '_machine_option') === null) {
$set($$selectedMachine . '_machine_option', null);
}
if ($get($$selectedMachine . '_machine_option') === null) {
$set($$selectedMachine . '_machine_option', null);
}
before creating the Select component, It feels a bit wrong but at least its works for now πŸ˜…
Want results from more Discord servers?
Add your server