<%= render component_tag(x: { data: "imageUploader({click: #{clickable?.to_json}, drop: #{droppable?.to_json}})", "@click.stop": "if (clickable) openPicker()", "@dragenter.stop.prevent": "active = true", "@dragover.stop.prevent": "active = true", "@dragleave.stop.prevent": "active = false", "@drop.stop.prevent": "active = false; handleDrop($event)", ":data-active": "active && droppable" }) do %> <%= file_field_tag(nil, accept: accept, class: "uploader-input", "x-ref": "input", "@click.stop": "", "@change": "handleFiles($el.files)") %> <%= content %> <% end %>