sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Hide a default list/library button in modern UI

Open rbarten opened this issue 8 years ago • 4 comments

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Is it currently possible to hide a default list/library Command Bar Button in the modern UI using a CustomAction? Or should I add this request to UserVoice?

Observed Behavior

For example, we would like to hide the default 'Export to Excel' button.

2018-02-21 13_31_21-app development - documents - test view

In the Classic view this could be done by a Custom Action:

<CustomAction
        Id="RemoveRibbonButtonLibrary"
        Location="CommandUI.Ribbon"
        RegistrationId="101" 
        RegistrationType="List">>
        <CommandUIExtension>
            <CommandUIDefinitions>
                <CommandUIDefinition Location="Ribbon.Library.Actions.ExportToSpreadsheet" />
            </CommandUIDefinitions>
        </CommandUIExtension>
</CustomAction>

But this doens't work for the Modern button. When we try location 'ClientSideExtension.ListViewCommandSet.CommandBar'. We get error: "The specified properties CommandUIExtension are not supported for client-side custom action".

We also cannot found anything related to hiding a button in the documentation: Customizing "modern" lists and libraries

rbarten avatar Feb 26 '18 20:02 rbarten

This is not currently supported, so we would request to open up a UserVoice entry for the new capability. Thx.

VesaJuvonen avatar Feb 27 '18 18:02 VesaJuvonen

Hi @VesaJuvonen , do we have any workaround for the same. Can we go creating an app customizer or any alternate css may be, but not supported in modern UI, I believe. Any workaround is much appreciated.

Thanks, Himanjan

himanjanpati avatar Mar 19 '18 07:03 himanjanpati

+1 , This is important requirement

ashu57 avatar Sep 25 '18 06:09 ashu57

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 28 '20 06:01 msft-github-bot