@@ -82,10 +82,16 @@ class KanbanBoard extends Component implements HasForms
8282 public array $ searchable = [];
8383
8484 /**
85- * Card data for form operations.
85+ * Card data for create form operations.
8686 */
8787 #[Validate]
88- public array $ recordData = [];
88+ public array $ createRecordData = [];
89+
90+ /**
91+ * Card data for edit form operations.
92+ */
93+ #[Validate]
94+ public array $ editRecordData = [];
8995
9096 /**
9197 * Number of cards to load when clicking "load more".
@@ -201,7 +207,7 @@ public function createRecordForm(Form $form): Form
201207 {
202208 $ form = $ this ->adapter ->getCreateForm ($ form , $ this ->currentColumn );
203209
204- return $ form ->model ($ this ->adapter ->baseQuery ->getModel ())->statePath ('recordData ' );
210+ return $ form ->model ($ this ->adapter ->baseQuery ->getModel ())->statePath ('createRecordData ' );
205211 }
206212
207213 /**
@@ -211,7 +217,7 @@ public function editRecordForm(Form $form): Form
211217 {
212218 $ form = $ this ->adapter ->getEditForm ($ form );
213219
214- return $ form ->model ($ this ->adapter ->baseQuery ->getModel ())->statePath ('recordData ' );
220+ return $ form ->model ($ this ->adapter ->baseQuery ->getModel ())->statePath ('editRecordData ' );
215221 }
216222
217223 /**
@@ -319,14 +325,14 @@ public function updateRecordsOrderAndColumn($columnId, $cardIds): bool
319325 public function openCreateForm (string $ columnId ): void
320326 {
321327 $ this ->currentColumn = $ columnId ;
322- $ this ->recordData = [];
328+ $ this ->createRecordData = [];
323329
324330 // Set the base model without filling yet
325331 $ this ->createRecordForm ->model ($ this ->adapter ->baseQuery ->getModel ());
326332
327333 // Pre-set the column field
328334 $ columnField = $ this ->config ->getColumnField ();
329- $ this ->recordData [$ columnField ] = $ columnId ;
335+ $ this ->createRecordData [$ columnField ] = $ columnId ;
330336 }
331337
332338 /**
@@ -351,8 +357,8 @@ public function openEditForm(string | int $recordId, string | int $columnId): vo
351357 return ;
352358 }
353359
354- // Set recordData first
355- $ this ->recordData = $ record ->toArray ();
360+ // Set editRecordData first
361+ $ this ->editRecordData = $ record ->toArray ();
356362
357363 // Clear form state to avoid reactivity issues
358364 $ this ->editRecordForm ->fill ([]);
@@ -361,7 +367,7 @@ public function openEditForm(string | int $recordId, string | int $columnId): vo
361367 $ this ->editRecordForm ->model ($ record );
362368
363369 // Now fill the form, which will allow nested components to initialize with the model's relationships
364- // Using the model's data directly instead of recordData to avoid reactivity loops
370+ // Using the model's data directly instead of editRecordData to avoid reactivity loops
365371 $ this ->editRecordForm ->fill ($ record ->toArray ());
366372 }
367373
@@ -415,7 +421,7 @@ public function createRecord(): void
415421 */
416422 private function resetCreateForm (): void
417423 {
418- $ this ->recordData = [];
424+ $ this ->createRecordData = [];
419425 $ this ->currentColumn = null ;
420426
421427 // Just clear the form without chaining methods
@@ -467,7 +473,7 @@ public function updateRecord(): void
467473 */
468474 public function resetEditForm (): void
469475 {
470- $ this ->recordData = [];
476+ $ this ->editRecordData = [];
471477 $ this ->currentRecord = null ;
472478
473479 // Just clear the form without chaining methods
0 commit comments