Преглед изворни кода

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

Don't wait until nextTick to remove x-cloak (remove in a microtask)
Caleb Porzio пре 4 година
родитељ
комит
34b86216a5
1 измењених фајлова са 1 додато и 2 уклоњено
  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 { 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')))))