Skip to content

Commit

Permalink
✨ Optimize external autosize
Browse files Browse the repository at this point in the history
  • Loading branch information
marcreichel committed Jun 30, 2023
1 parent 2c8c509 commit 6163a43
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 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.

7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ function Autosize(Alpine) {
el.removeEventListener("autosize", handler);
});
});

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

export default Autosize;

0 comments on commit 6163a43

Please sign in to comment.