SharePoint / SharePoint/sp-dev-docs

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

Open
#10,480 2 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Nov 14, 2025.

area:list-formatting sharepoint-developer-support type:bug-confirmed
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

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
  • 💥 Microsoft Edge
  • 💥 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.