$nextTick does not wait for the DOM update on Safari #2855
Unanswered
aldovincenti
asked this question in
5. Bugs
Replies: 2 comments 3 replies
-
|
I created a forceNextTick alpine magic helper function for this: Try this create a $forceNextTick.js file. Import it into your app.js file Then add this to your app.js file. You can read more about the issue here: vuejs/vue#9200 |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
It's not just Safari though and I wish we could solve this within Alpine to be a stable behavior? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Given a hidden input that is displayed after a button click, the input must immediately be set to focus, as soon as the button is clicked and the input is displayed. Since an element must be displayed to be set to focus, it is necessary to wait until the DOM is updated and the element is displayed. In this case, it should be possible to use $nextTick to meet the above requirements. It works on Chrome and Firefox (latest versions), but not on Safari. Using a setTimeout to wait for the DOM update works.
Browser: Safari 15.4
OS: macOS 12.3.1
Alpine version: 3.10.1
Code to reproduce the bug: https://jsfiddle.net/mortu9f2/
Beta Was this translation helpful? Give feedback.
All reactions