Sha256: 71e1a5dcf631e811f88f8579c7602074f880f7add70b9288fd76673b6bd35405

Contents?: true

Size: 670 Bytes

Versions: 6

Compression:

Stored size: 670 Bytes

Contents

<div x-data="{changed: false, applyChange(){ this.value = this.$refs.input.value; this.changed = false; }}">

  <div @change.stop="changed = ($event.target.value !== value)" class="flex items-center gap-2">
    <%= text_field_tag(name, value,
      **input_options,
      type: input,
      class: "flex-grow",
      "x-ref": "input",
      "@keydown.enter.stop": "applyChange"
    ) %>

    <%= lookbook_render :button,
      icon: :check,
      tooltip: "Apply changes",
      class: "flex-none !bg-lookbook-button-bg hover:!bg-lookbook-button-bg-hover rounded-md !text-lookbook-button-text",
      "x-show": "changed",
      "@click": "applyChange" %>
  </div>
</div>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lookbook-2.0.2 app/views/lookbook/inspector/inputs/_text_two_step.html.erb
lookbook-2.0.1 app/views/lookbook/inspector/inputs/_text_two_step.html.erb
lookbook-2.0.0 app/views/lookbook/inspector/inputs/_text_two_step.html.erb
lookbook-2.0.0.rc.3 app/views/lookbook/inspector/inputs/_text_two_step.html.erb
lookbook-2.0.0.rc.2 app/views/lookbook/inspector/inputs/_text_two_step.html.erb
lookbook-2.0.0.rc.1 app/views/lookbook/inspector/inputs/_text_two_step.html.erb