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

customCardProps stop working after column is updated using setValue

Open aaclage opened this issue 1 year ago • 4 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

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

Describe the bug / error

This issue appear using Custom List formatting and object customCardProps. Scenario has 2 Button objects:

  • First button call "customCardProps"
  • Second button update field using "setValue " When second button is called and update field, the object "customCardProps" from first button stops working.

Image steps: Shows when customCardProps stop working after setValue update. ErrorDialogStopsWorking

Code sample: Code used to reproduce the error, just use default Column "Title"

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "cursor": "pointer"
    },
    "children": [
      {
        "elmType": "button",
        "txtContent": "click me",
        "customCardProps": {
          "openOnEvent": "click",
          "beakStyle": {},
          "isBeakVisible": true,
          "directionalHint": "topCenter",
          "formatter": {
            "elmType": "div",
            "children": [
              {
                "elmType": "div",
                "style": {
                  "cursor": "pointer"
                },
                "txtContent": "Click to update",
                "customRowAction": {
                  "action": "setValue",
                  "actionInput": {
                    "Title": "='Value1 to '+ if(Number(@now)%7==0,1,if(Number(@now)%7==1,2,if(Number(@now)%7==2,3,if(Number(@now)%7==3,4,if(Number(@now)%7==4,5,6)))) + ' set'"
                  }
                }
              }
            ]
          }
        }
      },
      {
        "elmType": "div",
        "style": {
          "padding": "0 10px 0 10px"
        },
        "txtContent": "[$Title]"
      },
       {
         "elmType": "button",
          "txtContent": "random update",
          "customRowAction":{
            "action": "setValue",
            "actionInput": {
              "Title": "update setvalue and dialog stops working...."
            }
            
          }
       }
    ]
  }
}

Steps to reproduce

  1. Create Default List
  2. Add sample code
  3. Click first button and validate actions,
  4. click 2 button and validate action,
  5. return to 1 button and click and validate "customCardProps" appears

Expected behavior

customCardProps should continue to be available/work after the field is updated using secondary object using "setValue".

aaclage avatar Aug 11 '22 21:08 aaclage

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

ghost avatar Aug 11 '22 21:08 ghost

Hi @shagra-ms, Made additional tests and would like to address you the following issue.

aaclage avatar Aug 11 '22 21:08 aaclage

Will take a look

shagra-ms avatar Aug 11 '22 21:08 shagra-ms

@shagra-ms thanks. i will wait for the update.

aaclage avatar Aug 19 '22 06:08 aaclage