Browse Source

Add lowercase method to match other uses

Kevin Batdorf 4 năm trước cách đây
mục cha
commit
875fe908fa
3 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 2 2
      dist/alpine-ie11.js
  2. 2 2
      dist/alpine.js
  3. 1 1
      src/directives/for.js

+ 2 - 2
dist/alpine-ie11.js

@@ -5997,9 +5997,9 @@
   }
 
   function lookAheadForMatchingKeyedElementAndMoveItIfFound(nextEl, currentKey) {
-    if (!nextEl) return; // If the next El is a sibling template, we don't want it
+    if (!nextEl) return; // If the next El is a sibling template tag, we're done.
 
-    if (nextEl.tagName === 'TEMPLATE') return; // If the the key's DO match, no need to look ahead.
+    if (nextEl.tagName.toLowerCase() === 'template') return; // If the the key's DO match, no need to look ahead.
 
     if (nextEl.__x_for_key === currentKey) return nextEl; // If they don't, we'll look ahead for a match.
     // If we find it, we'll move it to the current position in the loop.

+ 2 - 2
dist/alpine.js

@@ -594,9 +594,9 @@
   }
 
   function lookAheadForMatchingKeyedElementAndMoveItIfFound(nextEl, currentKey) {
-    if (!nextEl) return; // If the next El is a sibling template, we don't want it
+    if (!nextEl) return; // If the next El is a sibling template tag, we're done.
 
-    if (nextEl.tagName === 'TEMPLATE') return; // If the the key's DO match, no need to look ahead.
+    if (nextEl.tagName.toLowerCase() === 'template') return; // If the the key's DO match, no need to look ahead.
 
     if (nextEl.__x_for_key === currentKey) return nextEl; // If they don't, we'll look ahead for a match.
     // If we find it, we'll move it to the current position in the loop.

+ 1 - 1
src/directives/for.js

@@ -112,7 +112,7 @@ function lookAheadForMatchingKeyedElementAndMoveItIfFound(nextEl, currentKey) {
     if (! nextEl) return
 
     // If the next El is a sibling template tag, we're done.
-    if (nextEl.tagName === 'TEMPLATE') return
+    if (nextEl.tagName.toLowerCase() === 'template') return
 
     // If the the key's DO match, no need to look ahead.
     if (nextEl.__x_for_key === currentKey) return nextEl