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.

Issue with Vue's async event loop

See original GitHub issue
[ ] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[x] Other, please describe

Hi there,

Thank you for this component. I ran into an issue caused by Vue’s async event loop.

To reproduce, go to this fiddle: https://jsfiddle.net/6b94mxes/

  • Open calendar, the time should be updating every second
  • Scroll up once on the minutes location to increase the minute by one. Do this right before the seconds is about to change to the next second

Expected behavior: The minute place will increase and the calendar will stop updating until one minute has passed.

Current behavior: DOM input takes a few moments to change v-model. So this.date is not updated quickly enough and the minute place reverts back to what it was.

Any advice on how to work around this?

Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
ankurk91commented, Jul 10, 2018

This will never solve. This is how js works.

1reaction
ankurk91commented, Jan 23, 2018

@bhulsman Your issue is different. When user clicks on reset (clear) button; v-model value needs to be updated so component emits input event with new value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loop out async data in vue component - Stack Overflow
Thanks for your answer. With your first example the error are gone but the loop never runs again (when the data are loaded)...
Read more >
Reactivity, Async, Render Problem - Vue Forum
We just ran into a slight problem that causes render to be executed synchronously rather than async. Once you're in the async's next-tick ......
Read more >
Vue.js Asynchronous Update Queue - Coding Explained -
We just saw how Vue.js reacts to any changes that we make to our data properties and updates the DOM accordingly. This is...
Read more >
Asynchronous JavaScript: The Event Loop, Callbacks ...
When the network request completes, the JavaScript runtime removes the asynchronous function from the callstack. Then the event loop picks ...
Read more >
Asynchronous JavaScript - Learn web development | MDN
In this article, we'll learn about synchronous and asynchronous programming, why we often need to use asynchronous techniques, and the problems ...
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