Skip to content

Commit

Permalink
Ensure closestDataStack exists before using as it wasn't introduced u…
Browse files Browse the repository at this point in the history
…ntil 3.5.2 (#2721)
  • Loading branch information
joshhanley committed Mar 7, 2022
1 parent af8faad commit c7be8a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/morph/src/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function morph(from, toHtml, options) {

// If there is no x-data on the element we're morphing,
// let's seed it with the outer Alpine scope on the page.
if (window.Alpine && ! from._x_dataStack) {
if (window.Alpine && window.Alpine.closestDataStack && ! from._x_dataStack) {
toEl._x_dataStack = window.Alpine.closestDataStack(from)

toEl._x_dataStack && window.Alpine.clone(from, toEl)
Expand Down

0 comments on commit c7be8a8

Please sign in to comment.