Sha256: c02b0251151aaa5e20b627df638b7ed0d83782123b3a3049f7ac82b07b1047bc

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

<%= edit_field_wrapper field: @field,
  index: @index,
  form: @form,
  resource: @resource,
  displayed_in_modal: @displayed_in_modal do %>
  <div data-controller="tags-field">
    <%# dummy field %>
    <%= text_field_tag "#{@field.id}-dummy", '',
      class: classes("w-full"),
      data: {
        'tags-field-target': 'fakeInput',
      },
      disabled: @field.readonly,
      placeholder: @field.placeholder,
      style: @field.get_html(:style, view: view, element: :input),
      value: ''
    %>
    <%# real field %>
    <%= @form.text_field @field.id,
      class: classes("hidden w-full border-primary-500 focus-within:border-primary-500"),
      data: {
        'tags-field-target': 'input',
        'whitelist-items': @field.suggestions.to_json,
        'disallowed-items': @field.disallowed.to_json,
        'enforce-suggestions': @field.enforce_suggestions ? 1 : 0,
        'delimiters': @field.delimiters,
        'close-on-select': @field.close_on_select ? 1 : 0,
      },
      disabled: @field.readonly,
      placeholder: @field.placeholder,
      style: @field.get_html(:style, view: view, element: :input),
      value: @field.field_value.to_json
    %>
  </div>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
avo-2.13.2.pre.2 app/components/avo/fields/tags_field/edit_component.html.erb
avo-2.13.2.pre.1 app/components/avo/fields/tags_field/edit_component.html.erb