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: Callout is not displayed when @currentField is set to src in embed action #9671

Open
2 of 9 tasks
tecchan1107 opened this issue May 6, 2024 · 1 comment
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@tecchan1107
Copy link
Contributor

tecchan1107 commented May 6, 2024

Target SharePoint environment

SharePoint Online

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

Declarative list formatting

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

No response

Describe the bug / error

If I set @currentField to the src of the embed action, the callout will not be displayed. If the internal name of the column is set, the callout will be displayed.

image

EmbedTest.mp4

Steps to reproduce

  1. Create a YouTube column (column internal name: YouTube, column type: single line of text) in the list

  2. Set the URL for embedding in the created column

    image

    YouTube video used for verification: https://www.youtube.com/watch?v=MHopBnmhPzg
    URL for embedding: https://www.youtube.com/embed/MHopBnmhPzg?si=sYT8Tpmn6dv5Sc1e

  3. Set the following JSON to the formatting of the created YouTube column

Code using the internal name of the column
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "cursor": "pointer",
        "border-radius": "7px",
        "padding": "5px 10px",
        "display": "=if(@currentField,'flex','none')",
        "align-items": "center"
      },
      "attributes": {
        "class": "ms-fontSize-s ms-fontColor-white ms-bgColor-themePrimary ms-bgColor-themeTertiary--hover"
      },
      "customRowAction": {
        "action": "embed",
        "actionInput": {
          "src": "[$YouTube]",
          "width": "640",
          "height": "360"
        }
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "margin-right": "5px"
          },
          "attributes": {
            "iconName": "MSNVideosSolid"
          }
        },
        {
          "elmType": "span",
          "txtContent": "Watch YouTube"
        }
      ]
    }
  ]
}

image

  1. Change YouTube column formatting created to the following JSON
JSON using @currentField
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "cursor": "pointer",
        "border-radius": "7px",
        "padding": "5px 10px",
        "display": "=if(@currentField,'flex','none')",
        "align-items": "center"
      },
      "attributes": {
        "class": "ms-fontSize-s ms-fontColor-white ms-bgColor-themePrimary ms-bgColor-themeTertiary--hover"
      },
      "customRowAction": {
        "action": "embed",
        "actionInput": {
          "src": "@currentField",
          "width": "640",
          "height": "360"
        }
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "margin-right": "5px"
          },
          "attributes": {
            "iconName": "MSNVideosSolid"
          }
        },
        {
          "elmType": "span",
          "txtContent": "Watch YouTube"
        }
      ]
    }
  ]
}

image

Expected behavior

Callouts are displayed even if @currentField is used.

@tecchan1107 tecchan1107 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label May 6, 2024
@arkogupta
Copy link
Contributor

@tecchan1107 Thanks for reporting the bug. We'll take up the fix soon. Will update on the timelines.

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

2 participants