question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dragged file input still shows required alert

See original GitHub issue

Describe the bug

When required is used in b-form-file and a file is dragged, it still shows select a file alert on submit.

It works fine with selecting file from the popup file system.

Steps to reproduce the bug

  1. Go to https://codesandbox.io/s/form-required-drag-0uccq
  2. Drag a file in the Choose file form.
  3. Submit form, it shows alert.
  4. Now click on Choose a file and select a file from the selector.
  5. Submit form, it works.

Expected behavior

  1. Go to https://codesandbox.io/s/form-required-drag-0uccq
  2. Drag a file in the Choose file form OR click on Choose a file and select a file from the selector.
  3. Submit form. It should work for both methods.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jul 12, 2019

PR #3674 appeared to fix the issue, but has caused other side-effects.

0reactions
tmorehousecommented, Jul 11, 2019

@hkchakladar Since you are controlling state of the input (via the state prop). You can add the novalidate attribute to the form to disable native browser validation on submit, add an invalid-feedback message to b-form-group, and also apply the same state value to b-form-group for triggering the validation message to show/hide.

See https://codesandbox.io/s/form-required-drag-29onl

If you want to have the validation state / message only showing, then you can compute the validation state in the submit handler of the form.

Read more comments on GitHub >

github_iconTop Results From Across the Web

drag drop files into standard html file input - Stack Overflow
I'd like to add the HTML5 enhancement. I know in some browsers you can sometimes (almost always) drop files into the file input...
Read more >
Drag and Drop File Uploading - CSS-Tricks
I wanted to enrich the feed import experience by making allowing for drag and drop file upload alongside the traditional file input.
Read more >
Using files from web applications - Web APIs - MDN Web Docs
Using the File API, web content can ask the user to select local files and then read the contents of those files. This...
Read more >
Easy File Uploading With JavaScript | FilePond - PQINA
Drag n' Drop ; dropOnPage, false, FilePond will catch all files dropped on the webpage ; dropOnElement, true, Require drop on the FilePond...
Read more >
Bootstrap File Input - © Kartik - Krajee JQuery Plugins
Ability to drag and drop files or images on to the fileinput plugin. ... php composer.phar require kartik-v/bootstrap-fileinput "dev-master".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found