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

List Formatting: Group header cannot be clicked even when setting `defaultClick` to `headerFormatter` in `groupProps` in the newer? Microsoft Lists

Open tecchan1107 opened this issue 8 months ago • 0 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

No response

Describe the bug / error

In the newer? Microsoft Lists, I cannot click on the group header even though I set defaultClick to headerFormatter in groupProps.

image

newer

In the older? Microsoft Lists, clicking on a group header with defaultClick set would display a view filtered by the value of that group header.

older

Steps to reproduce

  1. Create a list
  2. Create a choice column
  3. Create some items
  4. Grouping by choice column created in 2.
  5. Set the following JSON in the view formatting
Sample Code
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "style": {
        "font-size": "16px",
        "cursor": "pointer",
        "padding": "5px 10px",
        "border-radius": "5px"
      },
      "customRowAction": {
        "action": "defaultClick"
      },
      "attributes": {
        "class": "ms-bgColor-themeLighter ms-bgColor-themePrimary--hover ms-fontColor-white--hover"
      },
      "children": [
        {
          "elmType": "span",
          "txtContent": "@group.fieldData.displayValue"
        },
        {
          "elmType": "span",
          "style": {
            "margin-left": "5px"
          },
          "txtContent": "=' ('[email protected]+')'"
        }
      ]
    }
  }
}

Expected behavior

Clicking on a group header with defaultClick set will display a view filtered by the value of the group header, similar to the older Microsoft Lists

tecchan1107 avatar Jun 17 '24 04:06 tecchan1107