Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropzone file param missing when using drag&drop #237

Closed
DaveEshopGuide opened this issue May 23, 2022 · 3 comments · Fixed by #239
Closed

Dropzone file param missing when using drag&drop #237

DaveEshopGuide opened this issue May 23, 2022 · 3 comments · Fixed by #239

Comments

@DaveEshopGuide
Copy link

When using the Dropzone component in a form and then submitting the form, the parameter for the file is not submitted to the server, when Drag&Drop was used. It works when picking the file from the dialog.

Tried with and without multiple/accept options.

<%= form_with( url:import_path, builder: Polaris::FormBuilder) do |form| %>
          <%= polaris_form_layout do |form_layout| %>
            <% form_layout.item do %>
              <%= form.polaris_dropzone :import_file,
                                        multiple: false,
                                        accept: 'text/csv',
                                        error_overlay_text: 'File type must be .csv'%>
            <% end %>
            <% form_layout.item do %>
              <%= polaris_button(primary: true, submit: true) { "Upload & Import" } %>
            <% end %>
          <% end %>
        <% end %>

image

D&D:
image

File picked from dialog:
image

Using:
ruby '3.1.2'
'rails', '~> 7.0.3'
polaris_view_components (0.10.0)

Windows 11 Machine, Chrome Browser

@kirillplatonov
Copy link
Collaborator

@DaveEshopGuide thanks for reporting that. I totally missed that bug. I opened a PR that should fix that: #239

@kirillplatonov
Copy link
Collaborator

@DaveEshopGuide published v0.10.1 with fix for that issue.

@DaveEshopGuide
Copy link
Author

DaveEshopGuide commented Jun 7, 2022

@kirillplatonov Thanks, much appreciated ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants