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

Viewformatting | Setting commandBarProps "primary" and "position" breaks "hide" key

Open Tanddant opened this issue 2 months ago • 2 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Developer environment

Windows

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [x] 💥 Microsoft Edge
  • [x] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

Edge Version 142.0.3595.76 (Official build) (64-bit)

Describe the bug / error

I have some pretty long view formatting, which hides "Every button" except for the "automate", and "Export" buttons in the UI, so this is what I end up with ... all the "Kopi af...." are Quick steps triggering Power Automate

Image Image Image

The relevant formatting here is:

...
{
  "key": "automate",
  "hide": false,
  "text": "Opret",
  "iconName": "Add",
  "primary": true
},
...
{
  "key": "export",
  "hide": false
},
...

However, as you can see the "primary is not taking affect on the automate button" 🤷 - however assigning it a position solves that

...
{
  "key": "automate",
  "hide": false,
  "text": "Opret",
  "iconName": "Add",
  "primary": true,
  "position": 1
},
...
{
  "key": "export",
  "hide": false,
  "position": 2
},
...

But that introduces an interesting issue, under each of the drop down all of the otherwise hidden buttons now appear, without any other changes to the view formatting

Image Image

Steps to reproduce

  1. Create a list
  2. Hide all the fields (Formatting.json)
  3. See that export Power BI is visible
  4. Remove position from the two relevant buttons
  5. Observe that it's now there

Expected behavior

No matter the position of the "group" all the keys that I've requested to be hidden should remain hidden.

Tanddant avatar Nov 14 '25 08:11 Tanddant