Skip to content

Commit

Permalink
✨ Optimize autosize magic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcreichel committed Jun 30, 2023
1 parent 6163a43 commit d385c53
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
9 changes: 3 additions & 6 deletions dist/alpine-autosize.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/alpine-autosize.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/alpine-autosize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/alpine-autosize.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ function Autosize(Alpine) {
});
});

Alpine.magic("autosize", () => (el) => {
if (!el) {
return;
}
el.dispatchEvent(new Event("autosize"));
Alpine.magic("autosize", (node) => (el) => {
const element = el || node;
element.dispatchEvent(new Event("autosize"));
});
}

Expand Down

0 comments on commit d385c53

Please sign in to comment.