Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List formatting: Hide 'New' doesn't work when multiple Content Types are visible #10124

Open
9 tasks
MissHerku opened this issue Feb 20, 2025 · 1 comment
Open
9 tasks
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@MissHerku
Copy link

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

None

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

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

Bug

The Command Bar formatting fails to hide the "New" button. It does change the style of the button, but fails to hide it entirely.

Seems to be an issue with lists with multiple Content types.

Image

Workaround

Found a temporary fix

1. Go to list settings and choose "Change new button order and default content type"
Image
2. Hide all content types, except one
Image

Steps to reproduce

  1. Create list with at least two Content Types
  2. Add the following formatting to the list view
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideSelection": true,
  "commandBarProps": {
    "commands": [
      {
        "key": "new",
        "hide": true
      }
    ]
  }
}

Expected behavior

Usually Hiding the 'new' button works, no matter how many content type a list has.

Given that new content types is visible, by default, this error causes the formatting to break, each time new content types are added by end users

@MissHerku MissHerku added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Feb 20, 2025
@MissHerku
Copy link
Author

I see that this has already been discussed here: #9797 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

1 participant