Skip to content

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

@lucianobosco

Description

@lucianobosco

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 "").

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions