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

strength-meter-only - Empty payload on emitted event #32

Closed
xalunda opened this issue Jan 7, 2019 · 1 comment
Closed

strength-meter-only - Empty payload on emitted event #32

xalunda opened this issue Jan 7, 2019 · 1 comment

Comments

@xalunda
Copy link

xalunda commented Jan 7, 2019

I created a Vuetify text-field a my password input:

<v-text-field
    name="password"
    id="password"
    v-model="password"
    type="password"
    :rules="passwordRules"
    required
>

Appended the following
<password v-model="password" :strength-meter-only="true"/>

Expected Behavior

The meter fill should be filled with the score

Actual Behavior

The meter is not updated

I did some digging

The event emitted by the component has an empty payload, caused by:

watch: {
  value (newValue) {
    if (this.strengthMeterOnly) {
      this.emitValue(newValue)
    }
  }
}

While emitValue expects two arguments

methods: {
  emitValue (type, value) {
    this.$emit(type, value)
    this.password = value
  }
}

Therefore setting this.password to undefined

Environment

  • OS: Macos 10.13.6
  • NPM version: 6.5.0
  • vue.js version: 2.5.21
  • vue-password-strength-meter version: 1.4.0
@apertureless
Copy link
Owner

Oh yeah, good catch.

I did refactor the emitValue method and added a type and forgot to change the watcher.

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

No branches or pull requests

2 participants