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

fix: Clicking on dropzone component triggers onsubmit event on parent… #907

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

anjaneyasivan
Copy link
Contributor

Closes #

📑 Description

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

ℹ Additional Information


Review PR in StackBlitz Codeflow Submitted with StackBlitz Codeflow.

@stackblitz
Copy link

stackblitz bot commented Jul 7, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Jul 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-svelte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2023 7:01pm
flowbite-svelte-update ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2023 7:01pm

@shinokada
Copy link
Collaborator

Thank you for your PR.
Since the tag is button, you don't need to add type="button".

I close this PR but I'm looking forward to seeing your future PRs.
Thank you for your contribution.

@shinokada shinokada closed this Jul 14, 2023
@anjaneyasivan
Copy link
Contributor Author

@shinokada, thanks for clarifying. I happened to notice that the Dropzone.svelte file contains an input tag inside a button tag. I was just wondering if this is considered semantically correct. Thank you for your time and help!

@fuzzie360
Copy link

Hi @shinokada, I'm affected by the issue referenced here #906 and this fixes my issue exactly.

I don't understand the reason behind the closure:

Since the tag is button, you don't need to add type="button"

The default attribute for the button tag for many browsers is "submit" not "button". This will cause the Dropzone to trigger a form submit if it is in a form.

Perhaps Dropzone should be more props so that we can control wether Dropzone will submit or not submit depending on the use case.

Wdyt?

@shinokada shinokada reopened this Aug 7, 2023
@shinokada
Copy link
Collaborator

I reopened this and will merge it.
It will be in the next version.
Thank you for your PR.

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 this pull request may close these issues.

None yet

3 participants