Closed NgYueHong closed 3 months ago
@NgYueHong @zepfietje Hi all! It's not a bug.
There are two different operations edit (when you click on Edit from the list) and view.edit (when you click on Edit button from View page).
So you need to change your code from:
TextInput::make('email')->email()->required()->disabledOn('edit'),
TextInput::make('password')->password()->required()->hiddenOn('edit'),
To
TextInput::make('email')->email()->required()->disabledOn(['edit', 'view.edit']),
TextInput::make('password')->password()->required()->hiddenOn(['edit', 'view.edit']),
Here is a quick demo
https://github.com/filamentphp/filament/assets/4639175/b54e20e5-8e80-460f-9964-0b4d9934d663
Package
filament/filament
Package Version
3.2
Laravel Version
11
Livewire Version
No response
PHP Version
8.3
Problem description
The form input does not hide or disabled on edit.
The hide and disabled function does work when click on the edit button on the table.![image](https://github.com/filamentphp/filament/assets/6602432/b6bd60d6-d815-4723-90b6-f08a8448d1cd)
However, it does not work when click on the "edit" button from the modal.![image](https://github.com/filamentphp/filament/assets/6602432/6604f912-a3eb-4e16-81fe-8b3c6f3c4adb)
Expected behavior
The form should hide and disabled as well even if click from the modal button.
Steps to reproduce
Try to access the edit page from modal and you will see the
disabledOn()
andhiddenOn()
not working.Reproduction repository
https://github.com/NgYueHong/FilamentBug
Relevant log output
No response