hilla icon indicating copy to clipboard operation
hilla copied to clipboard

[autocrud] Add way to hide/show form of autocrud

Open krissvaa opened this issue 1 year ago • 1 comments

Describe your motivation

Add a way to hide/show the form of the autocrud to enable showing only when creating/editing an item. The form takes a lot of space, and it would be good to hide it till it is needed. Mobile already has something similar implemented OOTB with form opening in the dialog.

Describe the solution you'd like

One solution could be adding a boolean flag to enable this functionality.

<AutoCrud service={UserService} model={UserModel} hideForm={true} />

Show the form only after pressing the "New Item" button or the edit button. Hide the form after the successful save action.

Describe alternatives you've considered

Another solution would be to provide listeners for the edit action or the create new action so that users can implement show/hide functionality by themselves more easily.

krissvaa avatar Nov 06 '23 11:11 krissvaa

The naming seems unfortunate, hideForm sounds like “make form hidden” rather then “make form visible only when needed”.

platosha avatar Dec 05 '23 12:12 platosha