Alpine: Click outside event

Created on 3 Apr 2020  路  3Comments  路  Source: alpinejs/alpine

Hey,
is there some option for funning code if user clicked outside an element? Something like @clickOutside.
I think it would be really useful, for example for closing modals.

Most helpful comment

For this you should be able to use the .away modifier. Eg. @click.away

All 3 comments

For this you should be able to use the .away modifier. Eg. @click.away

@piotrpog have you had any more issues with this?

Hi guys. Gonna close this since @HugoDF provided an answer. If you've got any problems @piotrpog, please open another issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adevade picture adevade  路  3Comments

bep picture bep  路  4Comments

dstpierre picture dstpierre  路  4Comments

imliam picture imliam  路  5Comments

maxsite picture maxsite  路  4Comments