Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Usage in firefox causes infinite vue loop when v-model is used #188

Open
douglasg14b opened this issue Apr 22, 2019 · 4 comments
Open

Usage in firefox causes infinite vue loop when v-model is used #188

douglasg14b opened this issue Apr 22, 2019 · 4 comments

Comments

@douglasg14b
Copy link

douglasg14b commented Apr 22, 2019

This is a tricky one, and I can't reproduce it outside of my environment, you might have some ideas.

If the v-model for vuetify-algolia-places is blank, and I search and select a location. Vue goes into what seems to be an infinite loop. If v-model is omitted, it will select the location as expected. If v-model is a full address it hangs immediately upon loading the page.

This also only affects development builds, not production builds.

From a profiler call stack I see that these are the primary offenders (in this order):

  • updateChildComponent()
  • toString()
  • addDep()
  • CreateComponent()

On a flame-graph I see:

image

It seems this is made up of, almost entirely, of DOM updates from vue.

Any idea if there is something in this component tripping off an infinite loop of some kind in Vue? Maybe centered around

Note: This is the version before adding debounce, so not related to that. This also only affects Firefox.

@douglasg14b douglasg14b changed the title Usage in firefox causes infinite vue loop when v-model is initially blank Usage in firefox causes infinite vue loop when v-model is used Apr 22, 2019
@douglasg14b
Copy link
Author

I noticed if I use v-on:input two events are emitted when a location is selected instead of 1. Could this be related?

@douglasg14b
Copy link
Author

douglasg14b commented Apr 22, 2019

Actually, if I display the result of the v-on:input anywhere on the page it keeps firing v-on:input infinitely...

Think I found the source. Now why is it firing infinitely? And why only if I update the view from the result of the location being selected? (Even marking a checkbox as true will cause the infinite loop...)

@douglasg14b
Copy link
Author

It actually looks like anytime ANYTHING changes in the view, the component re-fires on:input events.

@Kocal
Copy link
Owner

Kocal commented Apr 24, 2019

Thanks for making some investigations :)

If the v-model for vuetify-algolia-places is blank

What do you mean by this? null, an empty string or an empty object?

I've tried the interactive playground on Firefox 60.6 and it's working fine. If I make the autocomplete clearable, I clear it, and I enter a new address, it works.

I noticed if I use v-on:input two events are emitted when a location is selected instead of 1. Could this be related?

Hum, that's possible, I'm seeing multiple places where input can be triggered twice:

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

No branches or pull requests

2 participants