Skip to content

Adding html data attributes to the content part of a native field component within a resource tool on a show page doesn't work #2407

Open
@felixwatts

Description

@felixwatts

Describe the bug

If I'm understand the docs then the code:

            <%= avo_show_field(
              :id, 
              as: :text, 
              html: {
                show: {
                  content: {
                    data: { foo_bar: "baz" }
                  }
                }
              }
            )
            %>

Should result in an HTML element with the attribute "data-foo-bar"="baz". But although the show field is rendered, the attribute is missing. Changing content to wrapper does render the attribute but on the wrong element.

Steps to Reproduce

  • Create a Resource Tool
  • Add the above field to it
  • Add the tool to the show page of a resource
  • Load that page in the browser

Expected behavior & Actual behavior

Somewhere in the HTML "data-foo-bar"="baz" should occur. but it doesn't.

Models and resource files

System configuration

Avo version:
3.0.2

Rails version:
7.1.3

Ruby version:
3.3.0

License type:

  • Community
  • Pro
  • Advanced

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Screenshots or screen recordings

Additional context

Impact

  • High impact (It makes my app un-usable.)
  • Medium impact (I'm annoyed, but I'll live.)
  • Low impact (It's really a tiny thing that I could live with.)

Urgency

  • High urgency (I can't continue development without it.)
  • Medium urgency (I found a workaround, but I'd love to have it fixed.)
  • Low urgency (It can wait. I just wanted you to know about it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNot necessarily a feature, but something has improvedGood first issueGood for newcomersHelp wantedWe could use some help with this

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions