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

$nextTick still executes before the window.confirm interrupts the DOM update on chrome but not on mozilla #10440

Closed
Abassion opened this issue Aug 26, 2019 · 1 comment

Comments

@Abassion
Copy link

Version

2.6.10

Reproduction link

https://codepen.io/Dadboz/pen/vYBxerr

Steps to reproduce

you have to test the demo on Mozilla and chrome by simply clicking the update button

What is expected?

expected the value to be updated before the confirm dialog fires

What is actually happening?

$nextTick still executes before the window.confirm dialog interrupts the DOM update on chrome but not on mozilla

@Abassion Abassion changed the title $nextTick still executes before the window.confirm dialog interrupts the DOM update on chrome but not on mozilla $nextTick still executes before the window.confirm interrupts the DOM update on chrome but not on mozilla Aug 26, 2019
@posva
Copy link
Member

posva commented Aug 26, 2019

The browser rendering the DOM vs rendering messages and blocking the rendering thread is something we cannot control. We can only ensure the DOM is updated, that's when nextTick triggers, you can use a console.log to check it. To ensure the view is also updated, use this

this.$nextTick(()=>{
          console.log(document.getElementById('app').textContent)
          requestAnimationFrame(() => {
             confirm('if you are using chrome notice that the value is not updated only after you resolve the dialog')   
          })
       }) 

@posva posva closed this as completed Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants