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.

Can't use fireEvent.update on a standard input field with Vuelidate

See original GitHub issue

I’m not sure if this is vuelidate related or not but fireEvent.update doesn’t seem to work on a standard input field. I can fix it by updating vue-testing-library.js to change the fireEvent.input to fireEvent.change

Such as on line 247.

    case 'INPUT':
      {
        if (['checkbox', 'radio'].includes(type)) {
          elem.checked = true;
          return fireEvent.change(elem);
        } else {
          elem.value = value;
          return fireEvent.input(elem);
        }
      }

to

    case 'INPUT':
      {
        if (['checkbox', 'radio'].includes(type)) {
          elem.checked = true;
          return fireEvent.change(elem);
        } else {
          elem.value = value;
          return fireEvent.change(elem);
        }
      }

The above change fixes the issue. Any chance we can use change instead of input. Perhaps there’s a bug with the input function.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
afontcucommented, Nov 22, 2020

#181 introduced the ability to mute the warnings

I’ll go ahead and close this one, as the changing the fired event on input/change is not desirable.

Thank you all!

1reaction
kinolicommented, Nov 22, 2020

yes that would be a welcome ability, to turn off the warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use `fireEvent.update` on input file · Issue #177 - GitHub
Create a component with an input file in it. Test it with fireEvent.update. Expected behavior. I expected it to accept fileList or array...
Read more >
Vuelidate doesn't update 'required'-validator, when inserting ...
When using the 'required'-validator, then it doesn't update, when I insert content into a text-field. CodeSandbox: https://codesandbox.io/s/ ...
Read more >
Vuelidate | A Vue.js model validation library
Simple, lightweight model-based validation for Vue.js.
Read more >
Advanced usage - Vuelidate
When using useVuelidate , Vuelidate will collect all validation $errors and $silentErrors from all nested components. No need to pass any props or...
Read more >
Validator (Smart GWT LGPL Edition API 13.0p (2022-12-13))
To use an applyWhen criteria the form or grid must use a DataSource . NOTE: applyWhen is not supported for "binary" fields. Server...
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