Skip to content

fix: not possible to drag&drop file with multiple dots #487

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

Merged
merged 2 commits into from
May 19, 2023

Conversation

iOvergaard
Copy link
Contributor

Description

Fixes #485

It is not possible to drag & drop files containing multiple dots in their name when using an "accept" filter.

This PR aims to change the behavior so that first and foremost, we split file names by . and then use the last dot and not the first.

Secondly, we are now treating and dividing accept parameters in a setter on the property so that it is only done once, and we now also support receiving file extensions both with and without a . in the accept property.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

How to test?

  1. Open Storybook and go to the "Accept" story
  2. Change the 'accept' property to something like "png" and try and upload files with one and two commas.

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

…and ensure that for file extensions, only the last entry after splitting "." is used
@iOvergaard iOvergaard enabled auto-merge (squash) May 17, 2023 14:03
@iOvergaard iOvergaard requested a review from JesmoDev May 17, 2023 14:05
@JesmoDev
Copy link
Contributor

LGTM

@iOvergaard iOvergaard merged commit f9c6343 into v1/contrib May 19, 2023
@iOvergaard iOvergaard deleted the v1/bugfix/dropzone-double-dot branch May 19, 2023 02:10
@iOvergaard iOvergaard added the bug Something isn't working label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UUIDropzone doesn't work if the name of the file contains a dot "."
2 participants