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.

b-input changes v-model from null to empty string on blur

See original GitHub issue

Describe the bug

By hydrating a b-input v-model with a null value and blurring the input with no changes, the object property is changed from null to an empty string "". This happens only the first time when the input is hydrated. If you hydrate it again with no page refresh, it works as expected.

Steps to reproduce the bug

  1. Hydrate the <b-input> with a null value for the v-model
  2. Focus the input
  3. Blur the input with no changes at all
  4. See how the property is changed from null to ""

Expected behavior

The object property must still as null

Versions

Libraries:

  • BootstrapVue: ~2.19.0
  • Bootstrap: ~4.4.1
  • Vue: ^2.6.12

Environment:

  • Device: Desktop
  • OS: Ubuntu 18
  • Browser: Chrome
  • Version: 86.0.4240.198 (Official Build) (64-bit)

Additional context

This is causing an issue with some 3rd party validators like vee-validate, where a pristine flag is set to false because changes were detected on the object (from null to "").

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jacobmllr95commented, Nov 24, 2020

@lucianobosco Yeah 😃

0reactions
lucianoboscocommented, Nov 24, 2020

@jackmu95 thanks! This is working as expected. Will this fix be included in the next release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Avoid converting null to empty string on b-input blur
EDIT This is getting odd. The way I propagate the resource to local data in the component is by clicking an element from...
Read more >
Vue-Multiselect | Vue Select Library
Useful for single selects that don't allow empty selection. Single select / dropdown. Select one.
Read more >
Component Events | Vue.js
A component can emit custom events directly in template expressions (e.g. in a v-on handler) using the built-in $emit method: template
Read more >
Vue form input validation using watchers - LogRocket Blog
Perform form validation in Vue using the watch option. Watchers are a great way to respond to data changes in a given element....
Read more >
ion-input: Custom Input Value Type Styling and CSS Properties
Inputs offer two options for clearing the input based on how you interact with it. The first way is by adding the clearInput...
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