Skip to content

Missing data attributes/targets from belongs_to field #4403

@lucasgeron

Description

@lucasgeron

Describe the bug

Given a field as: :belongs_to,
When rendering the edit form,
Then the data attributes from the Input are missing,
And when provide some data attribute manually
Then the missing data attributes/targets are added as expected

Reproduction repository for the bug

N/A

Steps to use in the reproduction repository

Steps to reproduce:

field :some_field,
      as: :belongs_to,
      nullable: true,
      searchable: true,
      can_create: false,
      hide_on: %i[index],
      html: lambda {
        edit do
          wrapper do
            classes do
               'hidden' unless record.some_condition?
            end
          end
          input do # comment this block for actual behavior, uncomment for expected behavior
            data do
              { foo: 'bar' } 
            end
          end
        end
      }

Expected behavior & Actual behavior

Actual Behavior
Data attributes are missing, and are set only if set some data-attribute were set manually.

Expected behavior
Have the data attributes without needed to set it manually.

System configuration

Avo version:
3.2.1

Rails version:
8.1.2

Ruby version:
3.4.7

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

When there is a custom data set manually

Image

When there is no custom data defined

Image

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

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions