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.

"this.$refs.fileinput.reset is not a function"

See original GitHub issue

I can’t seem to clear my b-form-file inputs.

I’ve tried everything, including this.$refs.fileinput.reset(), which returns “this.$refs.fileinput.reset is not a function” in firefox and chrome. Every other attempt simply does nothing.

Relevent code:

<b-form-group v-b-tooltip.hover title="Files">
  <b-form-file multiple placeholder="Upload files" ref="fileinput" type="file" v-model="files"/>
  <b-button @click="clearFiles">Reset</b-button>
</b-form-group>
export default {
  data() {
    return {
      files: [];
    };
  },
  methods: {
    clearFiles() {
      this.$refs.fileinput.reset();
    },
  },
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jan 3, 2019

Probably not. You may need to place the dev branch bootstrap-vue outside of node_modules, and do an import from that local directory (after building).

1reaction
tmorehousecommented, Dec 18, 2018

Ah, that is because we introduced the option to always have the navbar collapsed (acceptance of boolean true on toggleable prop). May need to update the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to reset/clear file Input - vue.js - Stack Overflow
inputFile.reset is not a function when I use this, but using this.$refs.inputFile.value=null worked for me.
Read more >
Child and $refs not a function - Laracasts
I'm calling the saveData() method from the parent like so. Copy Code saveItem() { this.$refs.actionInput.saveData(); },.
Read more >
This.$refs.form.validate is not a function - Get Help - Vue Forum
this.$refs.form[0].validate();​​ It's because may be you are using the component in a loop, so it's giving you a array if $refs. Try using...
Read more >
Form component — Vuetify
reset () will clear all inputs and reset their validation errors. this.$refs.form.resetValidation() will only reset input validation and not alter their state.
Read more >
V-File-Input .Click() Is Not A Function - ADocLib
refs.form.reset() Expected Behavior As the docs says, reset() will Resets validation for ... Will help fallback to a normal HTML file input for...
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