Commit a7343b8
committed
Fix removing multiple v-on event handlers
If we manipulate the DOM while iterating over it, the iteration may skip
elements. At the moment the library uses two different workarounds for
this: iterate over a shallow copy of the list using iterator_to_array()
(handleNode(), handleAttributeBinding()), or defer the manipulation
until after the loop (handleIf()). stripEventHandlers() did neither and
therefore failed to remove consecutive event handlers; fix that using
the defer approach, as I think that’s slightly more efficient in this
case. Also use removeAttributeNode() while we’re at it so that PHP
doesn’t have to look up the attribute by its name again.1 parent 5a9cb60 commit a7343b8
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
0 commit comments