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

[Bug] Error message for a required file upload is not shown correctly #1137

Closed
kai-oswald opened this issue Aug 31, 2017 · 1 comment · Fixed by tghelere/valorize-vidas#6 · May be fixed by devopsred/gaia#6, anikets43/angular-ngrx-socket-frontend#4 or jwlh/WDI_GROUP_PROJECT#2

Comments

@kai-oswald
Copy link

Overview of the problem

This is about the Bulma CSS framework, more specifically about the file upload input.

I'm using Bulma version [0.5.1]
My browser is: Chrome / Edge

Description

Trying to submit an empty required file input will not show the default error message correctly.
fileinputbug

Steps to Reproduce

  1. Add a form with a required file input
<form>
  <div class="file">
    <label class="file-label">
        <input class="file-input" type="file" name="file" required>
        <span class="file-cta">
            <span class="file-icon">
                <i class="fa fa-upload"></i>
            </span>
            <span class="file-label">
                Choose a file…
            </span>
        </span>
    </label>
  </div>
  <button type="submit" class="button is-primary is-outlined">Submit</button>
</form>
  1. Try submitting the form without uploading a file

Expected behavior

The browser's default error message is shown

Actual behavior

Chrome: The browser's default error message is only shown for a very short period
Edge: No error message is shown

@jgthms
Copy link
Owner

jgthms commented Sep 5, 2017

The file upload element requires to hide the default file upload, hence why it's experimental. I recommend disabling the submit button before any file is chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment