MudBlazor icon indicating copy to clipboard operation
MudBlazor copied to clipboard

Hide tool bar content

Open cesaremarasco opened this issue 3 years ago • 4 comments

Added a flag usefull to hide toolbarcontent dinamycally under specified conditions

cesaremarasco avatar Apr 07 '23 16:04 cesaremarasco

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.63%. Comparing base (cdbeeed) to head (c4ac728). Report is 1293 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6602      +/-   ##
==========================================
- Coverage   91.42%   90.63%   -0.79%     
==========================================
  Files         398      399       +1     
  Lines       14954    13582    -1372     
==========================================
- Hits        13671    12310    -1361     
+ Misses       1283     1272      -11     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 07 '23 16:04 codecov[bot]

Hi @cesaremarasco. Looks like there are no file changes in your PR, did you revert your first commit?

ScarletKuro avatar Apr 08 '23 11:04 ScarletKuro

Please can you check now. This flag (HideToolBarContent) is usefull when you need to hide dinamically toolbarcontent under specified conditions. Now look like that there isn't no way to hide toolbar content dinamically

cesaremarasco avatar Apr 10 '23 15:04 cesaremarasco

I think HideToolBar is a better name as the feature hides the entire <MudToolBar> and not only its content.

On the other hand, perhaps this extra parameter is overkill since the same can be achieved like so: <MudToolBar Style="display:none;"> or <MudToolBar Class="d-none">

Yomodo avatar Sep 25 '23 16:09 Yomodo

Would this count as "Disable something"?

Because since that is discouraged as of v7 wouldn't it be better to have something like ShowToolbar / ToolbarVisibleand have it default to true?

dennisrahmen avatar Jul 01 '24 21:07 dennisrahmen

Can this not be done with an @if( ... ) { } in razor by the user?

henon avatar Nov 18 '24 13:11 henon

I am pretty sure it can be done like this:

<ToolbarContent>
@if(_iWantToShowMyContent)
{
   This is my toolbar content
}
</ToolbarContent>

So this PR doesn't add value to the library IMO. Closing, but if you can bring forth good arguments why the parameter is needed we can reopen.

henon avatar Nov 18 '24 13:11 henon

I am pretty sure it can be done like this:

<ToolbarContent>
@if(_iWantToShowMyContent)
{
   This is my toolbar content
}
</ToolbarContent>

Not really. Even if the content inside the render fragment is empty, it will show an empty-space toolbar that takes space because of the --mud-internal-toolbar-height, gutters etc.

ScarletKuro avatar Nov 18 '24 14:11 ScarletKuro

I see, I wasn't aware that this is about MudTable. There is another workaround for this, you can conditionally supply null to the ToolbarContent renderfragment.

henon avatar Nov 18 '24 14:11 henon