Parcourir la source

Merge pull request #1570 from alpinejs/fix-x-cloak

Don't wait until nextTick to remove x-cloak (remove in a microtask)
Caleb Porzio il y a 3 ans
Parent
commit
34b86216a5
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      packages/alpinejs/src/directives/x-cloak.js

+ 1 - 2
packages/alpinejs/src/directives/x-cloak.js

@@ -1,5 +1,4 @@
 import { directive, prefix } from '../directives'
 import { directive, prefix } from '../directives'
 import { mutateDom } from '../mutation'
 import { mutateDom } from '../mutation'
-import { nextTick } from '../nextTick'
 
 
-directive('cloak', el => nextTick(() => mutateDom(() => el.removeAttribute(prefix('cloak')))))
+directive('cloak', el => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix('cloak')))))