-
I am currently using a Panel (\Laravel\Nova\Panel) with a BooleanGroup inside. The visibility of the BooleanGroup depends on another field and I can hide the BooleanGroup, but I can not hide the Panel, which causes to have an unexpected view. Because the Panel is empty and the title is still shown to the user, which can cause confusion. It would be nice to have a "dependsOn" functionality on the Panel, so we can hide the Panel depending on another Field/Panel. Current Code and Result:
Expected result when not checked, I would like to have the ability to hide completely the Panel even the Panel's title. Is there any workaround for the problem? Thank you for your time. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Panel doesn't have any knowledge of field reactive state since it can only access the default |
Beta Was this translation helpful? Give feedback.
-
So I imagine there is no easy way to make the panel reactive, is there any chance that we can have a reactive panel with a functionality "belongsTo" or something similar ? Thank you for your time. 😄 |
Beta Was this translation helpful? Give feedback.
-
@crynobone I have achieved a proof of concept if you're interested (I'll email you the code adjustments if you are). Hopefully we can get it in the core eventually. Here's a gif in action: |
Beta Was this translation helpful? Give feedback.
-
v4.13.0 For those wondering, there is no function like dependsOn, but the panels hides automatically when there is no visible field in the panel. |
Beta Was this translation helpful? Give feedback.
v4.13.0
Panels will now listen for changes, which allows them to be shown or hidden based on other fields.
For those wondering, there is no function like dependsOn, but the panels hides automatically when there is no visible field in the panel.