SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Hiding "Share" option in list command bar using JSON is not working #8546

Open ganesh-sanap opened 2 years ago

ganesh-sanap commented 2 years ago

What Should Happen

I am trying to hide "Share" option in list command bar using JSON formatting. I have tried below JSON in view formatting but it is not hiding the "Share" option.

{
  "commandBarProps": {
    "commands": [
      {
        "key": "share",
        "hide": true
      }
    ]
  }
}

I have also tried this JSON specifying all selectionModes for testing.

{
  "commandBarProps": {
    "commands": [
      {
        "key": "share",
        "hide": true,
        "selectionModes": [
          "SingleSelection",
          "MultiSelection",
          "NoSelection"
        ]
      }
    ]
  }
}

What Actually Happens

As per the Command bar customization syntax reference documentation, "Share" option should be hidden from command bar when using any one of the above JSON codes.

Screenshot related to this issue:

image

ghost commented 2 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

tecchan1107 commented 2 years ago

I was able to hide Share in the command bar in my environment!

commandbar

aaclage commented 2 years ago

Possible issue hidding menu options -> @shagra-ms I have the same issue as described by @ganesh-sanap. Below associated gif. ShareHide

shagra-ms commented 2 years ago

Thanks @ganesh-sanap @tecchan1107 @aaclage for sharing more repro details. We have a local repro now.

ganesh-sanap commented 2 years ago

@tecchan1107 Still not working for me. I tried it on 3 different tenants (2 standard release tenants and 1 targeted release tenants). Same issue on all tenants.

Fedes365 commented 2 years ago

It worked in the tenant I used for testing.

Hide-Command

CinziaTara commented 1 year ago

Hi, I have the same problem in my test tenant, in production the code works as expected. The only difference is the external sharing configuration which is enabled in the test tenant

Fedes365 commented 1 year ago

Tested in a production tenant and it didn't work as expected.

PowerPlatformAddict commented 1 year ago

If you notice where this works and hides the Share button is where that button does not have a drop down. In our tenant, we have under Share > Share Link , and Manage Access. So Share now has a drop down, the "share" hides share link now instead of the entire button. So you are left with Share and a drop down.

We need to identify how to hide the new Share button and Manage Access. Tried all sorts of variations in JSON but nothing worked.

daviduber1 commented 4 months ago

This also appears to stop working with the new Microsoft Lists interface