$getRecord() in a form changes when I click on an action button or a relation manager tab
Hi,
I'm trying to create a custom field as explained here:
https://filamentphp.com/docs/3.x/forms/fields/custom#custom-field-classes
From the generated view, if I dump record like that:
It works fine, until I click on a button launching a modal or a Tab switching to a different RelationManager below the form. The record seems to be emptied, and the code in custom field can't access to the record anymore unless I refresh the page...
Is it normal? And what could I do?
1 Reply
wire:ignore
to the parent div seems to do the trick!wire:ignore
prevents field to refresh (it makes sense)...
I solved it querying model again:
Not ideal, but surprisingly id keeps working unlike other attributes.
I'm curious about the reason behind this behaviour, and better alternatives if any